hydromodpy.workflow.internals.state#
Pipeline state - the object that flows between pipeline steps.
PipelineState is a frozen, generic dataclass that each step receives as
input and returns a new version of as output. Steps must never mutate a state
instance; instead they produce a successor via PipelineState.advance().
The state is parameterised by the payload type T. Concrete payloads are
the typed dataclasses defined below (ValidatedState, ResolvedState,
GeographicState, LoadedState …), one per pipeline step transition. The generic parameter
defaults to Mapping[str, Any] for callers that prefer state.data["key"]
style access.
Typed state hierarchy#
Each step refines the payload by adding fields. The payloads form an
inheritance chain so a step that consumes ResolvedState will also accept a
GeographicState (which IS-A ResolvedState):
ValidatedState
└── ResolvedState
└── GeographicState
└── LoadedState
└── MeshedState
└── SetupState
└── OpenStoreState
└── SolverRanState
└── ExtractedState
└── DerivedState
└── ExportedState
Classes
|
Payload after step 09 (derive). |
|
Payload after step 10 (export). |
|
Payload after step 08 (extract). |
|
Payload after the geographic/domain runtime has been built. |
|
Payload after data managers have loaded and bound external data. |
|
Payload after the mesh has been built or imported. |
|
Payload after step 06 (prepare_solver). |
|
State traversing the pipeline, immutable between steps. |
|
Payload after step 01 (resolve). |
|
Payload after step 05 (setup_process). |
|
Payload after step 07 (run_solver). |
|
Payload after step 00 (validate). |