hydromodpy.calibration.engine#

CalibrationEngine - orchestrates an ask/tell loop.

The engine is solver-agnostic and pipeline-agnostic: it takes a callable evaluator(values: dict[str, float]) -> EvaluationResult and runs the ask/tell loop until the optimizer converges or max_iter is reached.

save_runs modes (implemented via promote_best_n):

  • "none" (default): each iteration is only a DuckDB row. No Zarr.

  • "best_n": after the loop, promote the top save_best_n iterations

    into full simulations (caller-supplied promoter callable).

  • "all": each iteration is already a full simulation.

Classes

CalibrationEngine(space, optimizer, evaluator)

Drive an ask/tell loop until convergence or budget is exhausted.

CalibrationSession(session_id, optimizer, space)

Runtime result returned after a calibration loop.

ProgressReporter(*args, **kwargs)