hydro-suite 0.1.0

Umbrella crate: one dependency for the full multi-model hydrology suite (Xinanjiang/TOPMODEL/SWAT/API-CONT + calibration + metrics)
Documentation

hydro-suite

One dependency for the full multi-model hydrology suite.

crates.io docs.rs license

hydro-suite is the umbrella crate for the multi-model hydrology platform. A single dependency pulls in the core traits and evaluation metrics, four conceptual models (Xinanjiang, TOPMODEL, SWAT+ LTE, API-CONT), the DDS + SCE-UA calibrator, and the scenario orchestration / ensemble layer. The umbrella is a pure re-export — it adds no logic, so behavior is bit-identical to using the member crates directly.

Install

[dependencies]
hydro-suite = "0.1.0"

Quickstart

use hydro_suite::{BasinInfo, Forcing, ModelType, Scenario, ensemble_stats, run_scenario};

let forcing: Vec<Forcing> = (0..48)
    .map(|i| Forcing {
        p_mm: if (8..20).contains(&i) { 6.0 } else { 0.0 },
        pet_mm: 2.0,
        t_c: 18.0,
    })
    .collect();

let scenario = Scenario {
    basin: BasinInfo {
        id: "demo".into(), name: "Demo".into(),
        area_km2: 1000.0, outlet_lat: 30.0, outlet_lon: 120.0,
    },
    forcing, dt_h: 1.0,
    models: vec![ModelType::Xinanjiang, ModelType::Topmodel,
                 ModelType::Swat, ModelType::Apicont],
    observed: None, params_overrides: None,
};

let res = run_scenario(&scenario);
let stats = ensemble_stats(&res);
let mean_peak = stats.mean.iter().cloned().fold(f64::NEG_INFINITY, f64::max);
println!("ensemble mean peak = {:.2} m^3/s", mean_peak);

Run the full example:

cargo run --example run_all

Crates

One dependency, seven crates re-exported unchanged. Reach into a member crate (e.g. hydro_suite::hydro_xinanjiang::*) for the full API of any single model.

Crate What it gives you docs.rs
hydro-core HydroModel / DynHydroModel traits, forcing types, evaluation metrics (NSE / KGE / RMSE / PBIAS / R² + GB/T 22482 qualification + probabilistic: CRPS / Brier / POD-FAR-CSI / rank histogram) docs.rs/hydro-core
hydro-xinanjiang Distributed Xinanjiang model — 3-layer ET, saturation-excess runoff, 3 sources, unit-hydrograph + linear-reservoir routing (16 params) docs.rs/hydro-xinanjiang
hydro-topmodel TOPMODEL (Beven & Kirkby 1979) — 11-param distributed model, clean-room port of the R topmodel v0.7.5 C numerical core docs.rs/hydro-topmodel
hydro-swat SWAT+ LTE hydro-core (daily, hydrology-only subset) — clean-room port of USDA-ARS SWAT+ (public domain), bit-exact vs Fortran docs.rs/hydro-swat
hydro-apicont API-CONT — antecedent precipitation index continuous baseline (cheap, 3-param single linear store) docs.rs/hydro-apicont
hydro-calib Model-agnostic calibrator (DDS + SCE-UA) for any DynHydroModel, deterministic xorshift64 RNG, zero external deps docs.rs/hydro-calib
hydro-platform Multi-model orchestration: Scenario → run_scenario → per-model ModelResult / metrics / ensemble stats / probabilistic docs.rs/hydro-platform

Verification / Provenance

hydro-suite re-exports the 7 member crates unchanged — see each crate's README for per-model verification (bit-exact crosschecks vs OuyangWenyu/hydromodel for Xinanjiang, R topmodel C core for TOPMODEL, USDA-ARS SWAT+ Fortran for SWAT+ LTE, and GB/T 22482 thresholds for the metrics). The umbrella adds no logic, so those guarantees carry through unchanged.

Related crates

License

MIT.


中文

hydro-suite 是多模型水文平台的伞形 crate:一行依赖即可拿到全部 4 个概念性模型 (新安江 / TOPMODEL / SWAT+ LTE / API-CONT)、核心 trait 与评价指标 (NSE / KGE / CRPS + GB/T 22482 合格率)、率定器(DDS + SCE-UA)以及场景编排 / 集合层。本 crate 为纯 re-export,不含任何逻辑代码,行为与直接使用各成员 crate 完全一致。

安装:

[dependencies]
hydro-suite = "0.1.0"

运行示例:cargo run --example run_all(打印各模型洪峰 + 集合平均洪峰)。

成员 crate 列表与每个模型的 bit-exact 验证声明见上方 "Crates" 表与各 crate 的 README。