Skip to main content

A Python package for estimating environmental flow requirements using hydrological methods.

Project description

eflowpy

A Python Package for Estimating Environmental Flow Requirements in Rivers

eflowpy is a Python package for estimating environmental flow requirements using hydrological methods. It provides methods such as Flow Duration Curve (FDC), 7Q10, GEFC, and Tennant Method to analyze river flow conditions for environmental assessments.

๐ŸŒŸ Features

โœ” Calculate Flow Duration Curve (FDC) with exceedance probabilities
โœ” Compute 7Q10 low-flow values for drought analysis
โœ” Apply the Tennant Method for environmental flow assessments
โœ” Use GEFC (Generalized Environmental Flow Criteria) for water resource planning
โœ” Easily visualize FDC plots with Q-value markers (Q1, Q5, Q10, Q50, Q90, Q95)
โœ” Support for both daily and monthly streamflow data


๐Ÿ“ฆ Installation

To install eflowpy from PyPI:

pip install eflowpy

To install the development version:

git clone https://github.com/YOUR_USERNAME/eflowpy.git
cd eflowpy
pip install -e .

๐Ÿš€ Usage Examples

1๏ธโƒฃ Load Streamflow Data

from eflowpy.utils.data_reader import read_streamflow_data

df = read_streamflow_data("gauge_12013059_daily.csv")
print(df.head())

2๏ธโƒฃ Calculate Flow Duration Curve (FDC)

from eflowpy.hydrological.fdc import FlowDurationCurve

flow_series = df.iloc[:, 0]  # Extract flow column
fdc_method = FlowDurationCurve(flow_series)
fdc = fdc_method.calculate_fdc()

print(fdc.head())  # Show first few rows

3๏ธโƒฃ Get Specific Q-Values from FDC

q10 = fdc_method.get_flow_at_percentile(10)  # Q10 flow
q50 = fdc_method.get_flow_at_percentile(50)  # Median flow
q90 = fdc_method.get_flow_at_percentile(90)  # Low flow

print(f"Q10: {q10} mยณ/s, Q50: {q50} mยณ/s, Q90: {q90} mยณ/s")

4๏ธโƒฃ Plot FDC with Optional Q-Values

from eflowpy.utils.plotting import plot_fdc

plot_fdc(fdc, q_values=[1, 5, 10, 50, 90, 95])

๐Ÿ“‚ Folder Structure

eflowpy/
โ”œโ”€โ”€ eflowpy/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ core.py                # Base class for Environmental Flow methods
โ”‚   โ”œโ”€โ”€ hydrological/          # Hydrological methods directory
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”‚   โ”œโ”€โ”€ tennant.py         # Tennant Method
โ”‚   โ”‚   โ”œโ”€โ”€ fdc.py             # Flow Duration Curve (FDC)
โ”‚   โ”‚   โ”œโ”€โ”€ sevenq10.py        # 7Q10 Method
โ”‚   โ”‚   โ”œโ”€โ”€ gefc.py            # GEFC Method
โ”‚   โ”œโ”€โ”€ hydraulic/             # Hydraulic methods directory
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ utils/                 # Utility functions
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”‚   โ”œโ”€โ”€ data_reader.py     # Reads streamflow data
โ”‚   โ”‚   โ”œโ”€โ”€ plotting.py        # FDC Plotting functions
โ”‚   โ”œโ”€โ”€ setup.py               # Package configuration
โ”œโ”€โ”€ examples/                  # Example usage scripts
โ”‚   โ”œโ”€โ”€ test_fdc.py
โ”‚   โ”œโ”€โ”€ test_tennant.py
โ”œโ”€โ”€ README.md                   # Documentation
โ””โ”€โ”€ requirements.txt             # Dependencies

๐Ÿ—๏ธ Contributing

We welcome contributions! If youโ€™d like to add new methods, improve documentation, or fix bugs, please:

  1. Fork this repository.
  2. Create a new branch (feature-xyz).
  3. Submit a pull request.

๐Ÿ“œ License

This project is licensed under the MIT License - feel free to use and modify!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eflowpy-0.1.1.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eflowpy-0.1.1-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file eflowpy-0.1.1.tar.gz.

File metadata

  • Download URL: eflowpy-0.1.1.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for eflowpy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 41f36e39e39782703f1f67710c4edc443c20fb073dfdd0ff31accbae97b59e25
MD5 0e151eb92ffed9cc8c9c4e21c3ac0045
BLAKE2b-256 e988bfc99ae129968da0daa70355dee26a030add32e3a2f0f85021d39d984182

See more details on using hashes here.

File details

Details for the file eflowpy-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: eflowpy-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for eflowpy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d005f220e2151d621901c9ece24c49c7975370a9cc93e4a3e5ca31563c426cbd
MD5 962fcb9d93c0ca07fbd7204f365fadaa
BLAKE2b-256 f5f57c136668d20bb77086222c13041e66daa8d51104a6140a9d690adc4e97e2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page