PyBFS
PyBFS - Python Baseflow Separation
A Python implementation of physically-based Baseflow Separation algorithms for hydrological analysis. PyBFS uses a coupled surface-subsurface reservoir model to separate total streamflow into surface flow, baseflow, and direct runoff components.
Features
- Physically-based baseflow separation using coupled reservoir models
- Forecast baseflow using initial conditions
- Comprehensive visualization tools
- Well-documented API with NumPy-style docstrings
Installation
From PyPI (recommended)
pip install pybfs
From source
git clone https://github.com/BYU-Hydroinformatics/pybfs.git
cd pybfs
pip install .
Development installation
git clone https://github.com/BYU-Hydroinformatics/pybfs.git
cd pybfs
pip install -e .
Quick Start
import pandas as pd
from pybfs import get_values_for_site, base_table, PyBFS, plot_baseflow_simulation
# Load streamflow data
streamflow_data = pd.read_csv('streamflow.csv')
# Load site parameters
params_df = pd.read_csv('site_parameters.csv')
# Get parameters for specific site
site_number = 2312200
basin_char, gw_hyd, flow = get_values_for_site(params_df, site_number)
# Extract parameters
area, lb, x1, wb, por = basin_char[0], basin_char[1], basin_char[2], basin_char[3], basin_char[4]
alpha, beta, ks, kb, kz = gw_hyd[0], gw_hyd[1], gw_hyd[2], gw_hyd[3], gw_hyd[4]
# Generate baseflow table
SBT = base_table(lb, x1, wb, beta, kb, streamflow_data, por)
# Run PyBFS baseflow separation
result = PyBFS(streamflow_data, SBT, basin_char, gw_hyd, flow)
# Visualize results
plot_baseflow_simulation(streamflow_data, result)
Requirements
- Python 3.7 or higher
- numpy >= 1.19.0
- pandas >= 1.1.0
- matplotlib >= 3.3.0
Documentation
Full documentation is available at: Documentation
Paper data and reproduction scripts
The data and analysis scripts for the streamflow partitioning paper (Webster-Esho et al., manuscript under review) live in a separate repository: https://github.com/EniolaWebsterEsho/streamflow_separation_paper_2026
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Citation
If you use PyBFS in your research, please cite:
PyBFS - Python Baseflow Separation
BYU Hydroinformatics
https://github.com/BYU-Hydroinformatics/pybfs
Support
For issues, questions, or contributions, please visit: https://github.com/BYU-Hydroinformatics/pybfs/issues
Metadata
Release files for pybfs 0.2.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 |
|---|---|---|---|---|
| pybfs-0.2.0.tar.gz | 429.9 kB | Without provenance | Details for pybfs-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pybfs-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for pybfs-0.2.0-py3-none-any.whl |
Total release size: 468.6 kB
Release files / pybfs-0.2.0.tar.gz
| Download URL | pybfs-0.2.0.tar.gz |
|---|---|
| Size | 429.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5db00e556dd26a370052815e03c3600699e90555aa6e56d533b3f147897bddd2
|
|
BLAKE2b-256 checksum How to use checksums |
0f88f5d0fd9f741edc06ac5ab932dc509db6fcf762ca94ac556c531edddbe46c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.12
|
Release files / pybfs-0.2.0-py3-none-any.whl
| Download URL | pybfs-0.2.0-py3-none-any.whl |
|---|---|
| Size | 38.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ab3f3f2e4c8b7645e9e3db8d1f5104254e6ea7e340724fede82af10492aee82e
|
|
BLAKE2b-256 checksum How to use checksums |
194e6a1fc1f79ac97ebd7f784967d0a403324850e4aee1aafe9de7772495ef4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.12
|
Security for pybfs 0.2.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.