Skip to main content

jFUSE logo

JAX-based differentiable hydrological modeling framework implementing FUSE

CI PyPI version Python versions License

A fully differentiable JAX implementation of the Framework for Understanding Structural Errors (FUSE) hydrological model from Clark et al. (2008), with Muskingum-Cunge routing.

Note: jFUSE is in active development

Features

  • Fully differentiable: Automatic differentiation through the entire model using JAX
  • JIT-compiled: Fast execution with XLA compilation
  • FUSE decision file compatible: Read standard FUSE decision files to configure model structure
  • Muskingum-Cunge routing: Network-based streamflow routing with adaptive parameters
  • Gradient-based calibration: Built-in calibration with optax optimizers
  • GPU-ready: Seamless scaling to GPU with JAX

Requirements

  • Python >= 3.11
  • JAX >= 0.4.0
  • equinox >= 0.11.0
  • optax >= 0.1.7
  • numpy
  • xarray (for NetCDF I/O)

Installation

# Clone or download the package
git clone https://github.com/symfluence-org/jFUSE.git
cd jfuse

# Install in development mode
pip install -e .

# Or install with all dependencies
pip install -e ".[dev]"

# Or install with PyPi
pip install jfuse          # CPU
pip install jfuse[gpu]     # CUDA

Command Line Interface

jFUSE provides a CLI compatible with FUSE file manager format:

# Run simulation
jfuse run fm_catch.txt bow_at_banff

# Run gradient-based calibration
jfuse run fm_catch.txt bow_at_banff --mode=calib --method=gradient

# Show file manager configuration
jfuse info fm_catch.txt

Download Example Data

We provide a ready-to-use example dataset for jFUSE (lumped and distributed setups).

Download the ZIP release asset and unzip it into a data/ folder:

wget https://github.com/symfluence-org/jFUSE/releases/latest/download/jfuse-example-data.zip
unzip jfuse-example-data.zip
mv jfuse-example-data data

Lumped configuration example

This example calibrates a lumped jFUSE model using ERA5 forcing.

jfuse run \
  data/domain_Bow_at_Banff_lumped_era5/settings/FUSE/fm_catch.txt \
  Bow_at_Banff_lumped_era5 \
  --mode=calib \
  --method=gradient \
  --loss=kge \
  --lr=0.01 \
  --epochs=500 \
  --plot

Distributed configuration example

This example calibrates a distributed jFUSE model using a Muskingum–Cunge routing network.

jfuse run \
  data/domain_Bow_at_Banff_distributed/settings/FUSE/fm_catch.txt \
  Bow_at_Banff_distributed \
  --mode=calib \
  --method=gradient \
  --network=data/domain_Bow_at_Banff_distributed/settings/mizuRoute/topology.nc \
  --obs-file=data/domain_Bow_at_Banff_distributed/observations/streamflow/preprocessed/Bow_at_Banff_distributed_streamflow_processed.csv \
  --loss=kge,nse \
  --lr=0.01 \
  --epochs=1000 \
  --plot

License

GNU General Public License v3.0 (GPL-3.0-only) - see LICENSE file for details.

jFUSE implements the FUSE model of Clark et al. (2008); the original FUSE (NCAR/FUSE) is licensed GPL-3.0, and jFUSE is distributed under the same license.

References

  • Clark, M. P., et al. (2008). Framework for Understanding Structural Errors (FUSE). Water Resources Research, 44, W00B02.
  • Cunge, J. A. (1969). On the subject of a flood propagation computation method (Muskingum method). Journal of Hydraulic Research, 7(2), 205-230.

Metadata

Release files for jfuse 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jfuse 0.2.2
File Size Uploaded Provenance Actions
jfuse-0.2.2.tar.gz 151.9 kB Without provenance Details for jfuse-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jfuse 0.2.2
File Interpreter ABI Platform Actions
jfuse-0.2.2-py3-none-any.whl Python 3 none any Details for jfuse-0.2.2-py3-none-any.whl

Total release size: 301.2 kB

Release files / jfuse-0.2.2.tar.gz

Download URL jfuse-0.2.2.tar.gz
Size 151.9 kB
Tags Source
SHA-256 checksum
How to use checksums
55a750c4e3f51414aa32624ac64d878999ad003d0e988142d45ef9b6b7f540cc
BLAKE2b-256 checksum
How to use checksums
bce460ebb2e8a5a3e4dcffac81a045623cc31b2b8dc40d07727636b2675e857c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / jfuse-0.2.2-py3-none-any.whl

Download URL jfuse-0.2.2-py3-none-any.whl
Size 149.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c54677878f4ae39bef105ba667d878e3f0a3e647830c965214e0bf36643cd37
BLAKE2b-256 checksum
How to use checksums
c360977d003a3f7965f59cb78d94ce281d77540a01608421edc582ad9a072c3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Security for jfuse 0.2.2

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page