CalibrationReport#

MemberKindWhat it is
bestpropertyThe run of the one case (Session.best), None without a run.
best_by_casepropertyThe run of the best trial in each case (Session.best_by_case).
best_rel_dirpropertyDirectory of the run of the one case, relative to the project root.
best_sim_idpropertyId of the run of the one case, None when none was written.
sessionpropertyThe session on disk, None when the report names no session folder.
trialspropertyEvery trial of the session, one row per trial and case (Session.trials).
to_dictmethodReturn a JSON-friendly summary.
best_parametersattributePhysical values of the best candidate, keyed by calibrated parameter name.
best_trialattributeNumber of the best trial in trials.jsonl, unique in the session.
cost_block_fractionsattributeFraction of the cost each block actually took.
cost_labelattributeWhat the cost reads as, such as 1 - nse_log.
cost_nameattributeName of the cost the search minimized.
frozenattributeEvery value a settled phase declared frozen, in order, with the path it is written to.
methods_paragraphattributeThe prose this run writes about itself, conditioned on the stages that completed. It is the only object by which someone who did not produce the number can know what it rests on without reading Python.
methods_pathattributeThe methods.md file the paragraph was written to, in the session folder. None when there is no paragraph or no session folder.
parameter_uncertaintyattributeWidth beside each calibrated value, when the file asked for one.
phasesattributeThe phases of a staged calibration in the order they ran; empty without phases.
protocolattributeThe published method that wrote these stages, when one did.
restart_spreadsattributeWhere the restarts of each phase landed, when the file asked for restarts.
reused_from_diskattributeNames of the phases read back from the reopened session instead of solved.
session_dirattributeFolder the session journalled its trials in, sessions/<case>.
statusattributeHow the session closed: completed, partial, aborted or failed.
steady_windowattributeThe span a regime = "steady" phase actually averaged its recharge over: start, end, days, and mean_recharge_m_s when the steady phase's calibrated conductivity is known. None when no phase declares a steady regime. Read back from the same translation the run itself used (hydromodpy.calibration.runners.phase_regime.regime_overrides), never recomputed by a second reading of the file that could drift from it.
workspaceattributeProject root the session was written to.
class CalibrationReport(
session_id,
method,
n_trials,
best_cost,
duration_s,
save_runs,
promoted,
status='completed',
cost_name=None,
cost_label=None,
best_trial=None,
best_parameters=None,
best_cases=<factory>,
windows=<factory>,
parameter_uncertainty=(),
cost_block_fractions=None,
workspace=None,
session_dir=None,
phases=(),
frozen=(),
reused_from_disk=(),
restart_spreads=(),
steady_window=None,
protocol=None,
methods_paragraph=None,
methods_path=None,
extra=<factory>,
)[source]#

What one calibration found, with or without phases.

hmp.calibrate and Project.calibrate return this class, and with dry_run a plan that runs nothing. A calibration in phases fills phases, each with its own report, and frozen, and its best values are those of the calibrated run. to_dict gives the same summary as a JSON-friendly mapping.

The shape of this report and the [calibration] section are experimental until the rework of the calibration is published.

to_dict()[source]#

Return a JSON-friendly summary.

property best: Run | None[source]#

The run of the one case (Session.best), None without a run.

property best_by_case: dict[str, Run | None][source]#

The run of the best trial in each case (Session.best_by_case).

best_cases: dict[str, BestCase]#

its run and its cost, by case id.

Type:

What the best trial gave in each case

best_cost: float | None#

Lowest cost reached, None when no trial completed.

best_parameters: dict[str, float] | None = None#

Physical values of the best candidate, keyed by calibrated parameter name.

The whole set of the calibrated run: in a calibration in phases, the values an earlier phase froze come with those of the last phase. None when no candidate was evaluated.

property best_rel_dir: str | None[source]#

Directory of the run of the one case, relative to the project root.

property best_sim_id: str | None[source]#

Id of the run of the one case, None when none was written.

best_trial: int | None = None#

Number of the best trial in trials.jsonl, unique in the session.

cost_block_fractions: dict[str, Any] | None = None#

Fraction of the cost each block actually took.

"mean" averages the fraction over the finished trials (each a mapping of block name to its fraction, 0 to 1, of the cost), "mean_n_trials" is how many of them entered that average, and "best" reads the fraction at the reported candidate. None when the phase scores through a single metric with no declared [[calibration.objective_blocks]], or, for a phase reused from a previous run (see extra["cost_block_fractions_absent_note"] when that is why), when its journaled trials carry nothing to recompute it from. See hydromodpy.calibration.optim.objective.cost_block_fractions() for how a fraction is defined.

cost_label: str | None = None#

What the cost reads as, such as 1 - nse_log.

cost_name: str | None = None#

Name of the cost the search minimized.

duration_s: float#

Wall-clock duration of the search in seconds.

extra: dict[str, Any]#

Free-form metadata (callers may attach anything extra here).

frozen: tuple[FrozenParameter, ...] = ()#

Every value a settled phase declared frozen, in order, with the path it is written to.

A parameter two phases froze appears twice; the later value is the one the phases after both of them hold.

method: str#

Optimizer method name (e.g. "optuna").

methods_paragraph: str | None = None#

The prose this run writes about itself, conditioned on the stages that completed. It is the only object by which someone who did not produce the number can know what it rests on without reading Python.

methods_path: Path | None = None#

The methods.md file the paragraph was written to, in the session folder. None when there is no paragraph or no session folder.

n_trials: int#

Number of trials actually run (could be < max_trials if the optimizer converged).

parameter_uncertainty: tuple[Any, ...] = ()#

Width beside each calibrated value, when the file asked for one.

Empty unless [calibration.uncertainty] declared a method that produces it. The values themselves are in best_parameters and are never touched by it.

phases: tuple[PhaseRun, ...] = ()#

The phases of a staged calibration in the order they ran; empty without phases.

The report of a phase has no phases of its own.

promoted: int#

Count of trials promoted to runs after the search.

protocol: dict[str, Any] | None = None#

The published method that wrote these stages, when one did.

restart_spreads: tuple[Any, ...] = ()#

Where the restarts of each phase landed, when the file asked for restarts.

The calibrated value is untouched: it is the best of them. This says how far apart the others finished, which is the one thing a single search cannot report about itself.

reused_from_disk: tuple[str, ...] = ()#

Names of the phases read back from the reopened session instead of solved.

Only non-empty under hmp calibrate --resume: a phase is reused when it completed in the session and its recorded fingerprint matches this run’s own model, mesh and input files.

save_runs: str#

The save_runs mode used ("none", "best_n" or "all").

property session: Session | None[source]#

The session on disk, None when the report names no session folder.

session_dir: Path | None = None#

Folder the session journalled its trials in, sessions/<case>.

session_id: str#

Id of the session the search belongs to.

status: str = 'completed'#

completed, partial, aborted or failed.

Type:

How the session closed

steady_window: dict[str, Any] | None = None#

The span a regime = "steady" phase actually averaged its recharge over: start, end, days, and mean_recharge_m_s when the steady phase’s calibrated conductivity is known. None when no phase declares a steady regime. Read back from the same translation the run itself used (hydromodpy.calibration.runners.phase_regime.regime_overrides()), never recomputed by a second reading of the file that could drift from it.

property trials: pd.DataFrame[source]#

Every trial of the session, one row per trial and case (Session.trials).

windows: dict[str, PeriodWindow]#

The periods the best trial was scored on, by name.

workspace: Path | None = None#

Project root the session was written to.