Skip to main content

pyfloodrisk

Flood Risk Assessment Workflow for GR4H-Based Design Flood Analysis.

pyfloodrisk is a Python port of an R-based design flood workflow built around the GR4H hourly rainfall-runoff model. It covers the full pipeline from streamflow calibration through to design flood simulation:

  • GR4H — hourly production/routing rainfall-runoff model (pyfloodrisk.gr4h).
  • Calibration — DREAM-based calibration against observed streamflow, plus an optional robust re-calibration step that re-ranks the behavioural posterior against design storm events (calibration, behavioural_posterior, robust_calibration).
  • Event delineation — baseflow separation and hydrologic event extraction (peaks-over-threshold or local maxima), trimmed to the largest events per year by peak flow or volume (6 EY by default), and used to derive antecedent model states ahead of each event (hydro_event_pipeline, extract_initial_states).
  • Design storms — builds design storms from temporal-pattern increment files (build_design_storm).
  • Design flood simulation — runs GR4H forward across design storm patterns and antecedent states to produce a design flood ensemble (simulate_design_flood, run_demo_workflow).
  • Derived flood frequency analysis — a stratified Monte Carlo (joint probability) framework in the ARR event-based form, with the sampled initial loss replaced by a GR4H state vector drawn jointly from a continuous run, producing a full flood frequency curve rather than a single design event (pyfloodrisk.dffa; see docs/dffa.md).

A small bundled demo dataset (climate data and design storm increments for two stations) lets the whole workflow run end-to-end without any external data.

Installation

pip install pyfloodrisk

Optional extra: pip install pyfloodrisk[copula] for the copula and KDE methods of sampling the initial state distribution.

Quickstart

Design flood ensemble for one design storm:

from pyfloodrisk import run_demo_workflow

results = run_demo_workflow(station="117002A")

Derived flood frequency curve across the whole probability domain:

from pyfloodrisk import run_dffa

out = run_dffa(station="117002A")
print(out["results"].summary())

run_dffa is a demonstration — its design rainfalls are the station's bundled BoM IFD download, areally reduced with ARR2019ARF, and its parameters are plausible rather than calibrated. Design rainfalls enter one way only, from a CSV: ifd_table_from_bom_csv for a Bureau download as-issued, ifd_table_from_csv for a table you have tidied yourself. docs/dffa.md sets out what to replace before the numbers mean anything, and examples/dffa_demo.py builds the same analysis input by input.

License

MIT — see LICENSE.

Metadata

Release files for pyfloodrisk 0.2.1

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

Source distribution (sdist)

Source distribution for pyfloodrisk 0.2.1
File Size Uploaded
pyfloodrisk-0.2.1.tar.gz 2.7 MB Details

Built distribution (wheel)

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

Total release size: 5.5 MB

Release files / pyfloodrisk-0.2.1.tar.gz

Download URL pyfloodrisk-0.2.1.tar.gz
Size 2.7 MB
Tags Source
SHA-256 checksum
How to use checksums
999008d9b10590b1f51cfb4eeafd49ead9c1b579aed4b6f09d542ede261fd53e
BLAKE2b-256 checksum
How to use checksums
1c06ba44dbaf3437d95390ca7fb3223424643c22273325306da7e7118f1dd48c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / pyfloodrisk-0.2.1-py3-none-any.whl

Download URL pyfloodrisk-0.2.1-py3-none-any.whl
Size 2.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
6dbc62a2eabed09caff90441ceaf4939e471455347c590b20e3e3d8d9926ec04
BLAKE2b-256 checksum
How to use checksums
2dd73f4a1311e63f3168542b0aaacad8293268f6bd5c9255395615edd0ec7e68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

0.8.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.3.0

2 release files

This release

0.2.1 This release

2 release files

0.1.0

2 release files

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