tjrcr


Nametjrcr JSON
Version 2.0.0 PyPI version JSON
download
home_pagehttps://github.com/duynguyen02/tjrcr
SummaryLibrary for validating parameters for comprehensive reservoir regulation.
upload_time2024-08-28 17:42:18
maintainerNone
docs_urlNone
authorDuy Nguyen
requires_python<4.0,>=3.9
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # tjrcr

`tjrcr` is a Python library designed for validating parameters for comprehensive reservoir regulation. This library
provides methods to ensure that the input data meets specific criteria required for effective reservoir management, such
as having a full 12 months of data for each year and a minimum of 10 years of data.

## Installation

To install the library, use pip:

```bash
pip install tjrcr
```

## Usage

### Basic Example

```python
import pandas as pd
from tjrcr import is_comprehensive_regulation
from tjwb import TJWBResult  # This is referenced from the tjwb library

# Prepare your data
df = pd.DataFrame({
    'datetime': pd.date_range(start='2010-01-01', periods=120, freq='M'),
    'inflow_speed': range(120),
    'outflow_speed': range(120, 240)
})

# This is just an example for the TJWBResult class, please refer to the tjwb library for more details
tjwb_result = TJWBResult(
    datetime=df['datetime'],
    inflow_speed=df['inflow_speed'],
    outflow_speed=df['outflow_speed'],
    components_outflow_speed={}
)

# Validate parameters
result = is_comprehensive_regulation(
    tjwb_result=tjwb_result,
    eps=1.0,
    P=80.0,
    V_c=1000.0,  # Dead water level
    forced_gt_10_year=False,  # Allows the function to proceed even if your dataset spans fewer than 10 years.
    forced_12_months_each_year=False
    # Allows the function to proceed even if any year in your dataset has fewer than 12 months of data.
)

print(f"Is comprehensive regulation valid? {result}")
```

### Functions

- **`is_comprehensive_regulation`**: Validates whether the input data is suitable for comprehensive reservoir regulation
  based on certain criteria like minimum years of data, full monthly data per year, and comparison against a threshold
  value.

## Error Handling

The `tjrcr` library includes validation steps that raise exceptions if the input data does not meet the required
criteria:

- **Insufficient Years of Data**:
    - If the dataset does not span at least 10 years, a `ValueError` is raised.

- **Incomplete Monthly Data**:
    - If any year in the dataset does not have data for all 12 months, a `ValueError` is raised.

## Reference to `tjwb`

The `tjrcr` library references the `TJWBResult` class from the `tjwb` library, which handles the conversion of reservoir
data into a format suitable for analysis. You can find more details on how to use `TJWBResult` and related calculations
in the [tjwb GitHub repository](https://github.com/duynguyen02/tjwb).

## License

This library is released under the MIT License.

## Contact

If you have any questions or issues, please open an issue on [GitHub](https://github.com/duynguyen02/tjrcr/issues) or
email us at [duynguyen02.dev@gmail.com](mailto:duynguyen02.dev@gmail.com).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/duynguyen02/tjrcr",
    "name": "tjrcr",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "Duy Nguyen",
    "author_email": "duynguyen02.dev@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/6b/cc/c6e0377bb893fbbe30900d8ca3fce0dc4029935274fc2a3ef37a84eb3cae/tjrcr-2.0.0.tar.gz",
    "platform": null,
    "description": "# tjrcr\n\n`tjrcr` is a Python library designed for validating parameters for comprehensive reservoir regulation. This library\nprovides methods to ensure that the input data meets specific criteria required for effective reservoir management, such\nas having a full 12 months of data for each year and a minimum of 10 years of data.\n\n## Installation\n\nTo install the library, use pip:\n\n```bash\npip install tjrcr\n```\n\n## Usage\n\n### Basic Example\n\n```python\nimport pandas as pd\nfrom tjrcr import is_comprehensive_regulation\nfrom tjwb import TJWBResult  # This is referenced from the tjwb library\n\n# Prepare your data\ndf = pd.DataFrame({\n    'datetime': pd.date_range(start='2010-01-01', periods=120, freq='M'),\n    'inflow_speed': range(120),\n    'outflow_speed': range(120, 240)\n})\n\n# This is just an example for the TJWBResult class, please refer to the tjwb library for more details\ntjwb_result = TJWBResult(\n    datetime=df['datetime'],\n    inflow_speed=df['inflow_speed'],\n    outflow_speed=df['outflow_speed'],\n    components_outflow_speed={}\n)\n\n# Validate parameters\nresult = is_comprehensive_regulation(\n    tjwb_result=tjwb_result,\n    eps=1.0,\n    P=80.0,\n    V_c=1000.0,  # Dead water level\n    forced_gt_10_year=False,  # Allows the function to proceed even if your dataset spans fewer than 10 years.\n    forced_12_months_each_year=False\n    # Allows the function to proceed even if any year in your dataset has fewer than 12 months of data.\n)\n\nprint(f\"Is comprehensive regulation valid? {result}\")\n```\n\n### Functions\n\n- **`is_comprehensive_regulation`**: Validates whether the input data is suitable for comprehensive reservoir regulation\n  based on certain criteria like minimum years of data, full monthly data per year, and comparison against a threshold\n  value.\n\n## Error Handling\n\nThe `tjrcr` library includes validation steps that raise exceptions if the input data does not meet the required\ncriteria:\n\n- **Insufficient Years of Data**:\n    - If the dataset does not span at least 10 years, a `ValueError` is raised.\n\n- **Incomplete Monthly Data**:\n    - If any year in the dataset does not have data for all 12 months, a `ValueError` is raised.\n\n## Reference to `tjwb`\n\nThe `tjrcr` library references the `TJWBResult` class from the `tjwb` library, which handles the conversion of reservoir\ndata into a format suitable for analysis. You can find more details on how to use `TJWBResult` and related calculations\nin the [tjwb GitHub repository](https://github.com/duynguyen02/tjwb).\n\n## License\n\nThis library is released under the MIT License.\n\n## Contact\n\nIf you have any questions or issues, please open an issue on [GitHub](https://github.com/duynguyen02/tjrcr/issues) or\nemail us at [duynguyen02.dev@gmail.com](mailto:duynguyen02.dev@gmail.com).\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Library for validating parameters for comprehensive reservoir regulation.",
    "version": "2.0.0",
    "project_urls": {
        "Homepage": "https://github.com/duynguyen02/tjrcr",
        "Repository": "https://github.com/duynguyen02/tjrcr"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1a86a14e98feb417059e27bee5f236719ce2a7374cb7b46c04585c7aa69963ab",
                "md5": "176f91d3b579824b2b1e297122a5fef7",
                "sha256": "0f48d4c46965009e938ff73aa9b3c7630f75847b02b9a186fa6dcf53cea177e7"
            },
            "downloads": -1,
            "filename": "tjrcr-2.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "176f91d3b579824b2b1e297122a5fef7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 3378,
            "upload_time": "2024-08-28T17:42:16",
            "upload_time_iso_8601": "2024-08-28T17:42:16.356704Z",
            "url": "https://files.pythonhosted.org/packages/1a/86/a14e98feb417059e27bee5f236719ce2a7374cb7b46c04585c7aa69963ab/tjrcr-2.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6bccc6e0377bb893fbbe30900d8ca3fce0dc4029935274fc2a3ef37a84eb3cae",
                "md5": "fff5deb3d7ee1ed9a60cec8e999a14a3",
                "sha256": "9489899ba90f4b3b6a4c39a5d3345a7253ea1f107b02f251b9f9deeebf26abbb"
            },
            "downloads": -1,
            "filename": "tjrcr-2.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "fff5deb3d7ee1ed9a60cec8e999a14a3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 2929,
            "upload_time": "2024-08-28T17:42:18",
            "upload_time_iso_8601": "2024-08-28T17:42:18.078929Z",
            "url": "https://files.pythonhosted.org/packages/6b/cc/c6e0377bb893fbbe30900d8ca3fce0dc4029935274fc2a3ef37a84eb3cae/tjrcr-2.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-28 17:42:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "duynguyen02",
    "github_project": "tjrcr",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "tjrcr"
}
        
Elapsed time: 0.70714s