Skip to main content

Perform river routing computations on large river networks

Project description

River Route

Documentation Status 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

For local development:

git clone https://github.com/rileyhales/river-route.git
cd river-route
conda env create -f environment.yaml
conda activate rr
python -m pip install -e ".[all]"

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

Documentation

Build docs locally:

mkdocs serve

Testing

pytest tests -v

Integration tests use external sample data:

./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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

river_route-2.1.0-py3-none-any.whl (33.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: river_route-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 33.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for river_route-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 30ad9e0702ed32b43fa442bdae5cd4a73e84d2701ff2aace4d8d27b27f92bbce
MD5 3e11816bd7d1b64bb3a88635396183c6
BLAKE2b-256 3d4df68185af1b0aa255a61bf9a3dab42fd0a060b81a01e85ae4fd91bed325db

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