hydromodpy.physics.flow.history_contract#

Shared temporal contract helpers for transient flow histories.

Transient flow runtimes store:

  • snapshot histories on t0..tN for state-like variables,

  • one stress-period duration per accepted step on dt1..dtN.

Steady flow runtimes may still expose one state-like snapshot at elapsed time zero. That single row is the solved steady state, not an initial condition.

Downstream code should avoid inferring this relationship ad hoc. These helpers make the intended alignment explicit and reusable across exports, diagnostics and validation tooling. The contract is solver-agnostic: Boussinesq was the first backend to need it, but MODFLOW-family runtimes share the same shape.

Functions

build_transient_time_axes(period_lengths_seconds)

Return the canonical snapshot and step-end axes for one transient run.

elapsed_seconds_for_time_keys(...[, name])

Resolve explicit elapsed seconds for one exported time-key sequence.

history_has_initial_snapshot(*, n_slices, ...)

Return whether a history starts with an explicit initial snapshot.

snapshot_elapsed_seconds_from_payload(payload, *)

Return one snapshot elapsed-time axis from one history payload.

step_end_elapsed_seconds_from_payload(payload, *)

Return one step-end elapsed-time axis from one history payload.

step_history_from_history(values, *, ...)

Return one history aligned to one row per solved stress period.

Classes

TransientTimeAxes(period_lengths_seconds, ...)

Explicit time axes for one transient history payload.