hydromodpy.calibration.cli_runner#

CLI entry point hmp calibrate <calibration.toml>.

Workflow:

  1. Load the TOML and validate the [calibration] section into a CalibrationConfig.

  2. Prepare the downstream pipeline once via prepare_trials(), reusing the earliest-affected-step optimisation so setup phases do not re-run per trial.

  3. Drive the ask/tell loop through CalibrationEngine, where each evaluation forks the prepared context, runs the solver in lightweight mode, and extracts the objective in RAM via hydromodpy.calibration.metrics.build_metric_extractor().

  4. Persist every iteration into the DuckDB calibration_iterations table (sim_id left NULL by default).

  5. Honor save_runs – "best_n" / "all" promote the chosen trials through hydromodpy.calibration.promotion.

The objective argument is a Python escape hatch ("module.path:fn") for users who need a custom scalar – the TOML [calibration].objective + [calibration].variable pair already covers the standard NSE / KGE / RMSE cases.

Functions

run_calibration_cli(config_path, *[, ...])

Run a calibration described by config_path.

run_calibration_core(cfg, trial_ctx, *, ...)

Heart of the calibration loop.