STREAM-1D
1D open-channel hydraulics solver (Rust). Steady gradually varied flow (Standard Step) and unsteady Saint-Venant routing on single reaches. Optional culverts, bridges, and one steady tributary junction.
Primary interface: Python extension (stream1d). Also compiles to WebAssembly. Stateless API: geometry and boundary inputs in, profile arrays out.
This repository is the solver only. It does not include a GUI, project database, or HEC-RAS file importer. stream1d.com is a separate hosted application built on this engine (see License).
Capabilities
| Analysis | Structures | Limits |
|---|---|---|
| Steady GVF (subcritical, supercritical, mixed) | Culverts (FHWA inlet/outlet), bridges (HEC-RAS Class A/B/C, pressure, weir) | Single reach; one tributary junction (steady, subcritical) |
| Unsteady routing (single reach) | Inline culverts and bridges | Upstream Q(t), downstream WSEL(t); no multi-reach networks |
Full HEC-RAS comparison: docs/reference/hecras_parity.md.
Python
Install
pip install stream1d
Requires Python ≥ 3.7. Wheels are published for Linux, macOS, and Windows (see PyPI).
Install from source
For unreleased changes, clone the repository and build with Rust + maturin:
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install maturin pytest
maturin develop --features python
Rebuild with maturin develop --features python after pulling solver changes. Release process: docs/development/publishing.md.
Steady profile
import stream1d as st
xs_us = st.CrossSection(
station=1000.0,
x=[0.0, 0.0, 10.0, 10.0],
y=[6.0, 1.0, 1.0, 6.0],
n_stations=[0.0],
n_values=[0.025],
unit_system="Metric",
)
xs_ds = st.CrossSection(
station=0.0,
x=[0.0, 0.0, 10.0, 10.0],
y=[5.0, 0.0, 0.0, 5.0],
n_stations=[0.0],
n_values=[0.025],
unit_system="Metric",
)
result = st.solve_steady(st.SteadyInputs(
cross_sections=[xs_us, xs_ds],
flow_rate=15.0,
downstream_wsel=1.5,
regime=0,
))
print(result["wsel"])
print(result["velocity"])
Unsteady routing
result = st.solve_unsteady(st.UnsteadyInputs(
cross_sections=[xs_us, xs_ds],
initial_wsel=[2.0, 1.5],
initial_q=[14.0, 14.0],
dt=60.0,
num_steps=5,
upstream_q_hydrograph=[14.0] * 5,
downstream_wsel_hydrograph=[1.0] * 5,
))
print(result["wsel"][-1])
JSON fixtures
Load geometry from JSON with stream1d.import_utils.cross_section_from_dict. Example fixtures: tests/fixtures/wasm_steady_culvert_tier1.json, tests/fixtures/wasm_steady_bridge_bu_bd_v22.json.
Culvert, bridge, junction, and rating-curve examples: docs/python/getting_started.md.
Interactive notebook
python/stream1d_verification.ipynb — profiles and HEC-RAS comparison plots. First Binder build may take several minutes.
Inputs and outputs
Cross sections — river station; (x, y) cut polyline; Manning n zones (n_stations, n_values); optional is_overbank, blocked_obstructions, ineffective_flow_areas.
Steady — flow_rate, regime (0 subcritical, 1 supercritical, 2 mixed), downstream boundary (downstream_wsel, normal depth, rating curve, etc.). Structure fields: culvert_*, bridge_*.
Unsteady — initial_wsel, initial_q, dt, num_steps, upstream_q_hydrograph, downstream_wsel_hydrograph. Same structure fields as steady.
Results — wsel, velocity, area, froude_number, critical_wsel, energy_grade_slope. With culverts: control type, inlet/outlet HW, barrel and weir discharge. With bridges: flow regime, head loss. Unsteady structure outputs are [time_step][structure_index].
Field reference: python/stream1d/__init__.py, docs/wasm_api.types.ts. Equations: docs/reference/equations.md.
Verification
| Case | Reference | Tolerance |
|---|---|---|
| ConSpan culvert 5/25/50 yr profiles | python/verification/hecras_conspan_profiles.json |
±0.04 ft WSEL |
| Bridge abutments (WSPRO) | python/verification/bridge_abutment_hecras.json |
±2 mm HW |
| Bridge BU/BD faces | python/verification/bridge_bu_bd_hecras.json |
±2 mm HW |
PYTHONPATH=python python python/test_hecras_culvert_verification.py
cargo test --test bridge_bu_bd_hecras_verification
Test commands: docs/development/testing.md.
Build targets
| Target | Command | Notes |
|---|---|---|
| Python | maturin develop --features python |
Default for research and scripting |
| WebAssembly | bash build_wasm.sh |
Browser (pkg/) and Node (pkg-node/) |
WASM API: docs/web/wasm_integration.md.
Documentation
| Document | Contents |
|---|---|
docs/python/getting_started.md |
Culvert, bridge, unsteady Python examples |
docs/reference/equations.md |
GVF, Saint-Venant, culvert and bridge theory |
docs/reference/hecras_parity.md |
Scope vs HEC-RAS |
docs/reference/api_changelog.md |
Input schema versions |
docs/BRIDGE_INTERIOR_SECTIONS_API.md |
BU/BD interior sections |
docs/web/wasm_integration.md |
WASM build and JavaScript usage |
docs/development/testing.md |
Test suites and CI |
docs/development/publishing.md |
PyPI trusted publishing and releases |
tech_spec.md |
Host-application architecture |
Repository layout
src/solvers/ steady, unsteady, culvert, bridge, junction
python/ stream1d bindings, verification data, notebook
docs/ reference manuals and WASM types
tests/ Rust integration tests and JSON fixtures
examples/wasm/ Node smoke tests and sample payloads
License
Engine (this repository): MIT License.
stream1d.com web application: separate proprietary product (Lillywhite Water Solutions LLC), not covered by this license.
Metadata
Release files for stream1d 0.1.1
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 |
|---|---|---|---|---|
| stream1d-0.1.1.tar.gz | 166.3 kB | With provenance | Details for stream1d-0.1.1.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| stream1d-0.1.1-cp37-abi3-win_amd64.whl | CPython 3.7 | abi3 | Windows x86-64 | Details for stream1d-0.1.1-cp37-abi3-win_amd64.whl |
| stream1d-0.1.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.7 | abi3 | Linux glibc 2.17+ x86-64 | Details for stream1d-0.1.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
| stream1d-0.1.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.7 | abi3 | Linux glibc 2.17+ ARM64 | Details for stream1d-0.1.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
| stream1d-0.1.1-cp37-abi3-macosx_11_0_arm64.whl | CPython 3.7 | abi3 | macOS 11.0+ ARM64 | Details for stream1d-0.1.1-cp37-abi3-macosx_11_0_arm64.whl |
Total release size: 2.7 MB
Release files / stream1d-0.1.1.tar.gz
| Download URL | stream1d-0.1.1.tar.gz |
|---|---|
| Size | 166.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
df5d8b0ad87a8e3a4e3bc4602d7e5f2dcb10b81b93752d7174bd2679dbd9b46d
|
|
BLAKE2b-256 checksum How to use checksums |
f88b49de160233d9099a66ec1ceb4d2df77207103877f8315741b529866fec2a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 9, 2026.
Transparency logRelease files / stream1d-0.1.1-cp37-abi3-win_amd64.whl
| Download URL | stream1d-0.1.1-cp37-abi3-win_amd64.whl |
|---|---|
| Size | 550.1 kB |
| Tags | CPython 3.7 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
41f199342336c4f41271d40eba70824dcdfc0019046291be095cc90ce60e3252
|
|
BLAKE2b-256 checksum How to use checksums |
cbdec312a4e886343f5e7a5181f15f67805ebb373c102f573f8c2a04c6a0feb0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 9, 2026.
Transparency logRelease files / stream1d-0.1.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | stream1d-0.1.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 677.5 kB |
| Tags | CPython 3.7 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
9645f1d2072f8a046e33f0c15aad33a3f05b313088c20b41ee92ba8b69fb0ea7
|
|
BLAKE2b-256 checksum How to use checksums |
1b5e6c623e766442e841a3fb8271dd34dd955a5e70447a6a4dbebf2d5034a0e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 9, 2026.
Transparency logRelease files / stream1d-0.1.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | stream1d-0.1.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 660.6 kB |
| Tags | CPython 3.7 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
2d07affe140e4902e763b6698756843f4af61af968c8b24d0aa9cd30c3bb5eba
|
|
BLAKE2b-256 checksum How to use checksums |
84d2d945e2f2248d121ea66ccb349a68c2cf42e26f836bbbef67a03f0dd6993f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 9, 2026.
Transparency logRelease files / stream1d-0.1.1-cp37-abi3-macosx_11_0_arm64.whl
| Download URL | stream1d-0.1.1-cp37-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 619.0 kB |
| Tags | CPython 3.7 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
efd4daba0436ee4fc392a0e0d1d928043dd1d9f87ed6d68a9c3906c60400ef12
|
|
BLAKE2b-256 checksum How to use checksums |
a02d8aa0ab79594b1ef92d71abb4847263fe7ceaf09bc39442983fae28698738
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 9, 2026.
Transparency logSecurity for stream1d 0.1.1
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.
Full provenance
All 5 files in this release have been uploaded with provenance metadata.
Attestation for stream1d-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 9, 2026.
Transparency logA 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.