SolverAdapter#
- class hydromodpy.solver.SolverAdapter(*args, **kwargs)[source]#
Bases:
ProtocolOne adapter binds one
(process_type, solver_name)pair.- validate(ctx)[source]#
Fail-fast precondition checks before
execute.- Parameters:
ctx (
RunContext)- Return type:
- execute(ctx)[source]#
Run the concrete solver for
ctx.runand return its outputs.- Parameters:
ctx (
RunContext)- Return type:
- cleanup(ctx)[source]#
Release temporary scratch files after extraction completes.
- Parameters:
ctx (
RunContext)- Return type:
- extract_observables(ctx, store, requests, *, time_index=None)[source]#
Read every requested observable from this run, keyed by request id.
The whole batch arrives at once so a backend opens each binary file once instead of once per request, and a backend driven through an API knows before the solve which timesteps it has to keep.
Lightweight calibration trials read straight from the solver scratch dir via
ctx.state.execution.output_dirs_by_run_id;storeis the cold-pathCatalogreserved for backends that already wrote results to it.An adapter that cannot produce a requested observable raises
ObservableNotAvailableErrornaming it. That refusal is the contract: a caller never reads a signature to find out what a backend supports.