Calibration Architecture#
This page is the code-oriented entry point for the calibration stack. It groups the package map, the runtime classes, the execution-flow diagrams, and the case-vs-core boundary in one place.
For the full operational reference (TOML sections, optimizer catalogue, storage rules, pitfalls, Python API), see Calibration Guide.
Architecture map#
The current calibration stack is split into four layers:
hydromodpy/calibration/cli_runner.pyowns thehmp run <calibration.toml>workflow entry point: validates the config, builds the engine, runs the optimizer, writes the report.programmatic_runner.pyexposes the same flow for in-process use.hydromodpy/simulation/execution/trial.pyowns the prepare-once, evaluate-many primitive used by every trial inside the ask/tell loop.hydromodpy/calibration/(engine, parameters, objective, optimizer, diagnostics, persistence) owns the reusable engine, parameter sets, objective handling, method dispatch, and canonical results.hydromodpy/calibration/cases/owns runnable scientific cases that exercise the full calibration loop end to end.
Recommended reading path#
When reading the code from the published docs:
hydromodpy/cli/commands/run.py([workflow].mode = "calibration"dispatch)hydromodpy/calibration/cli_runner.pyhydromodpy/calibration/engine.pyhydromodpy/simulation/execution/trial.pyone case under
hydromodpy/calibration/cases/
Companion files:
hydromodpy/calibration/README.mdfor the package map.Calibration Guide for the end-to-end reference.
Case-local docstrings under
hydromodpy/calibration/cases/for runnable examples.
Core classes (config)#
This diagram focuses on validated configuration and method-selection objects.
Core classes (main runtime)#
This diagram focuses on the reusable runtime objects exchanged during one calibration session.
Calibration activity#
The high-level activity view of one calibration session driven by
hmp run.
Calibration sequence#
The handoff between the CLI entry point and the generic calibration engine.
Reservoir sequence (case example)#
How one runnable calibration case plugs into the shared core.
Devkit sequence#
The developer tooling used to scaffold and validate new calibration cases.
Case / core structure#
How runnable calibration cases are organized around the shared
calibration core: where core/ ends and cases/ begins.
Notes:
Case packages under
hydromodpy/calibration/casesare expected to stay thin adapters around the shared engine.CLI-specific concerns such as manifests, reruns, and report persistence are owned by
hydromodpy/calibration/cli_runner.pyand the reporting helpers inhydromodpy/calibration/persistence.pyandreport.py.
See also#
Calibration Guide for the full operational reference.
Calibration Workflow for the user-facing hub.
Calibration for inverse-problem formulation and methods.
Calibration Benchmarks for stable benchmark pages.