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 — ifd_table_from_bom_csv, reading a Bureau IFD download as it was issued. 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.5.0

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.5.0
File Size Uploaded
pyfloodrisk-0.5.0.tar.gz 3.6 MB Details

Built distribution (wheel)

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

Total release size: 7.2 MB

Release files / pyfloodrisk-0.5.0.tar.gz

Download URL pyfloodrisk-0.5.0.tar.gz
Size 3.6 MB
Tags Source
SHA-256 checksum
How to use checksums
572f0650a81911940573015a793eebd85f3cd24b829a2d1c4468769895ce967a
BLAKE2b-256 checksum
How to use checksums
bec04405a14f8dacd5da495ab99fd7072fc2cc431fb94456269be8fd5f13b72c
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.5.0-py3-none-any.whl

Download URL pyfloodrisk-0.5.0-py3-none-any.whl
Size 3.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
d6090fde7dc73d3e4f2e8d79e6dec5993e36fb5183fb3adf514265c433e11b25
BLAKE2b-256 checksum
How to use checksums
dd0a0e39428be9b731471e6a5deee62d3d9015a58da289891b83e1a3a3cdf471
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

This release

0.5.0 This release

2 release files

0.4.2

2 release files

0.3.0

2 release files

0.2.1

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