Differentiable Hydrologic Model Library
Reason this release was yanked:
Includes insecure pye file.
Project description
HydroDL2: Differentiable Hydrologic Models
A library of hydrological models developed on PyTorch and designed alongside 𝛿MG for the creation of end-to-end differentiable models, enabling parameter learning, bias correction, missing process representation, and more.
See 𝛿MG/examples using HydroDL2-based HBV models for published differentiable parameter learning (dPL) applications.
Installation
uv pip install hydrodl2
For development installs, see setup.
Quick Start
import hydrodl2
# List all available models
hydrodl2.available_models()
# {'hbv': ['hbv', 'hbv_1_1p', 'hbv_2', 'hbv_2_hourly', 'hbv_2_mts', 'hbv_adj']}
# Load a model class
Hbv = hydrodl2.load_model('hbv')
# Instantiate and use in a differentiable pipeline
model = Hbv()
Models are standard torch.nn.Module subclasses and can be composed with neural networks via δMG for end-to-end differentiable training.
Available Models
| Model | Name | Description |
|---|---|---|
| HBV 1.0 | hbv |
Base differentiable HBV model |
| HBV 1.1p | hbv_1_1p |
HBV with capillary rise modification |
| HBV 2.0 | hbv_2 |
Multi-scale HBV with elevation-dependent parameters |
| HBV 2.0 Hourly | hbv_2_hourly |
Sub-daily variant of HBV 2.0 |
| HBV 2.0 MTS | hbv_2_mts |
Multi-timescale variant of HBV 2.0 |
| HBV Adjoint | hbv_adj |
Implicit scheme with adjoint-based gradients |
Repository Structure
.
├── src/
│ └── hydrodl2/
│ ├── api/ # Main API
│ │ ├── __init__.py
│ │ └── methods.py # Methods exposed to end-users
│ ├── core/ # Methods used internally
│ ├── models/ # Shared models directory
│ │ └── hbv/ # HBV model variants
│ └── modules/ # Augmentations for δMG models
├── docs/
├── tests/
└── pyproject.toml
Citation
This work is maintained by MHPI and advised by Dr. Chaopeng Shen. If you find it useful, please cite:
Shen, C., et al. (2023). Differentiable modelling to unify machine learning and physical models for geosciences. Nature Reviews Earth & Environment, 4(8), 552--567. https://doi.org/10.1038/s43017-023-00450-9
BibTeX
@article{shen2023differentiable,
title={Differentiable modelling to unify machine learning and physical models for geosciences},
author={Shen, Chaopeng and others},
journal={Nature Reviews Earth \& Environment},
volume={4},
number={8},
pages={552--567},
year={2023},
publisher={Nature Publishing Group},
doi={10.1038/s43017-023-00450-9}
}
Contributing
We welcome contributions! See CONTRIBUTING.md for details.
Please submit an issue to report any questions, concerns, or bugs.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hydrodl2-1.3.0.tar.gz.
File metadata
- Download URL: hydrodl2-1.3.0.tar.gz
- Upload date:
- Size: 1.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e930f695daf54e6a7e839896f3413efcb8669b2ea5ff98907b020ad963d598be
|
|
| MD5 |
9a3e33b84f090a1fb228cf62d935f536
|
|
| BLAKE2b-256 |
e61512f5e2b5837f18789886d8ef169131a9b5d043b71f53a42140cbdfbc812e
|
Provenance
The following attestation bundles were made for hydrodl2-1.3.0.tar.gz:
Publisher:
build-wheels.yaml on mhpi/hydrodl2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hydrodl2-1.3.0.tar.gz -
Subject digest:
e930f695daf54e6a7e839896f3413efcb8669b2ea5ff98907b020ad963d598be - Sigstore transparency entry: 924080817
- Sigstore integration time:
-
Permalink:
mhpi/hydrodl2@fabf5d248434bac9e37181369f6defef0f818a30 -
Branch / Tag:
refs/tags/v1.3.0 - Owner: https://github.com/mhpi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-wheels.yaml@fabf5d248434bac9e37181369f6defef0f818a30 -
Trigger Event:
release
-
Statement type:
File details
Details for the file hydrodl2-1.3.0-py3-none-any.whl.
File metadata
- Download URL: hydrodl2-1.3.0-py3-none-any.whl
- Upload date:
- Size: 59.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84b21dac8d410f1e765e39d920a643177da19b2b841fa1e416ae665e2b1cb2c8
|
|
| MD5 |
1f806bd8f4788d1e8c6efa19b6d39be7
|
|
| BLAKE2b-256 |
c501b93785d7d333fdee658e3bcdd647f5ced07d31a67fba5406f6797a945238
|
Provenance
The following attestation bundles were made for hydrodl2-1.3.0-py3-none-any.whl:
Publisher:
build-wheels.yaml on mhpi/hydrodl2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hydrodl2-1.3.0-py3-none-any.whl -
Subject digest:
84b21dac8d410f1e765e39d920a643177da19b2b841fa1e416ae665e2b1cb2c8 - Sigstore transparency entry: 924080820
- Sigstore integration time:
-
Permalink:
mhpi/hydrodl2@fabf5d248434bac9e37181369f6defef0f818a30 -
Branch / Tag:
refs/tags/v1.3.0 - Owner: https://github.com/mhpi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-wheels.yaml@fabf5d248434bac9e37181369f6defef0f818a30 -
Trigger Event:
release
-
Statement type: