Skip to main content

Perform river routing computations on large river networks

Project description

River Route

PyPI version GitHub repo size License

river-route is a Python package for routing runoff and discharge through large river networks. It uses numba-compiled kernels and sparse matrix operations for efficient Muskingum-family routing at watershed scale.

Router Options

Router Use case
Muskingum Channel routing only (no lateral runoff input).
RapidMuskingum Route runoff directly to channels at each timestep.
UnitMuskingum Transform runoff with a unit hydrograph before channel routing.

Installation

pip install river-route

Or from source:

# create/activate an environment e.g. conda create -n rr python=3.12 && conda activate rr
git clone https://github.com/rileyhales/river-route.git
cd river-route
python -m pip install -e .

Quick Start

import river_route as rr

(
    rr
    .RapidMuskingum("examples/config_rapid_muskingum.yaml")
    .route()
)

Configuration can be provided by:

  1. A YAML/JSON config file path.
  2. Keyword arguments.
  3. Both (kwargs override file values).

Core required inputs are:

  • params_file (network topology and Muskingum parameters)
  • One runoff source (qlateral_files or grid_runoff_files + grid_weights_file) for transform routers
  • discharge_dir (or explicit discharge_files)

CLI

rr --help
rr RapidMuskingum examples/config_rapid_muskingum.yaml
rr UnitMuskingum examples/config_unit_muskingum.yaml

Testing

pytest is not a required dependency. You need to install pytest separately to run tests.

./tests/download_test_data.sh
pytest tests -v -s

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

river_route-2.1.1.tar.gz (24.3 kB view details)

Uploaded Source

Built Distribution

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

river_route-2.1.1-py3-none-any.whl (33.5 kB view details)

Uploaded Python 3

File details

Details for the file river_route-2.1.1.tar.gz.

File metadata

  • Download URL: river_route-2.1.1.tar.gz
  • Upload date:
  • Size: 24.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for river_route-2.1.1.tar.gz
Algorithm Hash digest
SHA256 302024dcaeff424523e9fd87a953f93f989e807594aff9dd71b8d1075a0e088e
MD5 8abd165227f29bcbee1406ab19906326
BLAKE2b-256 e8a2457ad01fa1566223d62e41bbffc8eb6cb662c396be63fab3d98a2fdc564a

See more details on using hashes here.

Provenance

The following attestation bundles were made for river_route-2.1.1.tar.gz:

Publisher: python-publish.yaml on rileyhales/river-route

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file river_route-2.1.1-py3-none-any.whl.

File metadata

  • Download URL: river_route-2.1.1-py3-none-any.whl
  • Upload date:
  • Size: 33.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for river_route-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 820004e1e99797500d4ef50f9d2c6d23b77bc3f0553b4f16d974bfd1801dc400
MD5 3cb76d84678b7964df20d754c773b11b
BLAKE2b-256 315582265a4dfad0c06c1c133062df1f5ddbde7e462103c89d73b7ca2aa0062d

See more details on using hashes here.

Provenance

The following attestation bundles were made for river_route-2.1.1-py3-none-any.whl:

Publisher: python-publish.yaml on rileyhales/river-route

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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