physics#
hydromodpy.physics is the process layer. It turns validated
configuration into the runtime Flow and Transport objects
that solver adapters consume. Forcing alignment and the optional
pyhelp coupling also live here.
Sub-modules#
physics/base/– generic process contracts.ProcessSpatial[TIC]ABC plus the prototypes forInitialCondition,BoundaryCondition,SinkSource, andProcessSpatialConfig.physics/flow/– concrete groundwater-flow process.Flowruntime,FlowConfigPydantic, dedicated initial / boundary / sinks-sources payloads.physics/transport/– concrete transport process.Transportruntime plus per-solver parameter blocks (modpath.parameters,mt3dms.parameters,modflow6gwt.parameters).physics/forcing/–ForcingBridgeandtime_alignmenthelpers that turnLoadResultinto solver-ready series.resolve_forcingdispatches on spatial mode (homogeneous vs heterogeneous).physics/hydrology/– conceptual helpers:pyhelp/wraps PyHELP (preprocessing ERA5 grids, output JSON / NetCDF);synthetic/generates analytical recharge and ETP series.
Key public symbols#
hydromodpy.physics.base.process_spatial.ProcessSpatialhydromodpy.physics.flow.flow.Flowhydromodpy.physics.flow.flow_config.FlowConfighydromodpy.physics.transport.transport.Transporthydromodpy.physics.transport.transport_config.TransportConfighydromodpy.physics.forcing.forcing_bridge.ForcingBridgehydromodpy.physics.forcing.time_alignment.align_to_stress_periods
Process contract#
Every concrete process inherits ProcessSpatial[TIC]:
class ProcessSpatial(ABC, Generic[TIC]):
parameters: dict[str, FieldParam]
initial_conditions: TIC | None
boundary_conditions: dict[str, BoundaryCondition]
sinks_sources: dict[str, SinkSource]
@abstractmethod
def build_initial_conditions(self, ...) -> TIC | None: ...
@abstractmethod
def set_boundary_conditions(self, ...): ...
@abstractmethod
def set_sinks_sources(self, ...): ...
The shared base is intentionally narrow: the per-process payload
(FlowInitialConditions, TransportInitialConditions) carries
the meaning, the abstract methods carry the lifecycle.
Recommended reading path#
hydromodpy/physics/base/README.mdhydromodpy/physics/base/process_spatial.pyhydromodpy/physics/flow/README.mdhydromodpy/physics/flow/flow.pyandflow_config.pyhydromodpy/physics/forcing/forcing_bridge.pyhydromodpy/physics/transport/transport.pyonce the flow path is clear.
Layer-matrix neighbours#
Allowed targets:
core,schema,physics.Documented tolerance:
physics->spatialbecauseFlowConfigembeds a discriminated union ofFieldSectionvariants. Do not extend that tolerance to other models.Allowed sources:
simulation,solver,calibration,analysis,config,workflow,cli.
See also#
solver for the backend adapters that consume process objects.
spatial for the
FieldSectiondiscriminated union and the mesh contract.Add a Process – step-by-step recipe.
Add a Config Field for the per-field conventions on
FlowConfig/TransportConfig.