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.3.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.3.0
File Size Uploaded
pyfloodrisk-0.3.0.tar.gz 2.7 MB Details

Built distribution (wheel)

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

Total release size: 5.5 MB

Release files / pyfloodrisk-0.3.0.tar.gz

Download URL pyfloodrisk-0.3.0.tar.gz
Size 2.7 MB
Tags Source
SHA-256 checksum
How to use checksums
4f5060871722e1dbf07568afd7aa8935ba6f4c60cb0af167d25a1dcacc764aec
BLAKE2b-256 checksum
How to use checksums
c13aedb82e04719812837fdd85ed6c56019e66d67ae8076d08be8579811f6d24
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.3.0-py3-none-any.whl

Download URL pyfloodrisk-0.3.0-py3-none-any.whl
Size 2.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
c1c166fe6ed7100f55e5a15f513f54de732248139b04e42e5a6d27a6a99dbeca
BLAKE2b-256 checksum
How to use checksums
84f1dd3d002b510cc2a45068ca3d370bfe8904c72d492da1aa6544af9fbf712b
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

This release

0.3.0 This release

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