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:
pip install tjrcr
Usage
Basic Example
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
ValueErroris raised.
- If the dataset does not span at least 10 years, a
-
Incomplete Monthly Data:
- If any year in the dataset does not have data for all 12 months, a
ValueErroris raised.
- If any year in the dataset does not have data for all 12 months, a
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.
License
This library is released under the MIT License.
Contact
If you have any questions or issues, please open an issue on GitHub or email us at duynguyen02.dev@gmail.com.
Metadata
Release files for tjrcr 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tjrcr-2.0.0.tar.gz | 2.9 kB | Without provenance | Details for tjrcr-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tjrcr-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for tjrcr-2.0.0-py3-none-any.whl |
Total release size: 6.3 kB
Release files / tjrcr-2.0.0.tar.gz
| Download URL | tjrcr-2.0.0.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9489899ba90f4b3b6a4c39a5d3345a7253ea1f107b02f251b9f9deeebf26abbb
|
|
BLAKE2b-256 checksum How to use checksums |
6bccc6e0377bb893fbbe30900d8ca3fce0dc4029935274fc2a3ef37a84eb3cae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.3 Linux/6.8.0-41-generic
|
Release files / tjrcr-2.0.0-py3-none-any.whl
| Download URL | tjrcr-2.0.0-py3-none-any.whl |
|---|---|
| Size | 3.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0f48d4c46965009e938ff73aa9b3c7630f75847b02b9a186fa6dcf53cea177e7
|
|
BLAKE2b-256 checksum How to use checksums |
1a86a14e98feb417059e27bee5f236719ce2a7374cb7b46c04585c7aa69963ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.3 Linux/6.8.0-41-generic
|
Security for tjrcr 2.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.