core#
hydromodpy.core is the kernel leaf. Every other layer may import
from it, and core itself must not import sibling layers.
Sub-modules#
Module |
Role |
|---|---|
|
|
|
|
|
Lightweight contract types reused across layers. |
|
|
|
|
|
Canonical goodness-of-fit metrics: |
|
Reproducible random-number wrappers. |
|
Runtime registries shared by launcher and execution:
|
|
|
|
TOML readers and writers used by |
|
|
|
|
|
|
Key public symbols#
Often imported by other layers:
hydromodpy.core.config_kit.profile.Profile– visibility enum.hydromodpy.core.units.{Length, Time, FlowRate, ...}– unit aliases.hydromodpy.core.workspace.workspace.Workspace– workspace facade.hydromodpy.core.metrics.goodness_of_fit.{nse, kge, rmse, ...}– canonical metrics.hydromodpy.core.io.{json_dumps, json_loads, HTTPClient}– deterministic JSON, HTTP client.hydromodpy.core.tracking.input_file.InputFile– file-tracking annotation.hydromodpy.core.state.{WorkflowContext, ExecutionRegistry}– runtime registries.hydromodpy.core.logging.LogManager– shared logger.
Recommended reading path#
hydromodpy/core/units/types.pyto learn the unit aliases used everywhere in Pydantic models.hydromodpy/core/config_kit/profile.pyandintrospect.pyto understand the visibility model.hydromodpy/core/workspace/{config.py, resolve.py, workspace.py}for the four-branch resolution.hydromodpy/core/state/__init__.pyfor the cross-layer contexts.hydromodpy/core/metrics/goodness_of_fit.pyfor the metric contract.
Auth backend#
core/auth/ carries the actor-resolution abstraction shared by the
catalog audit trail and the privacy purge worker:
core/auth/protocol.pydefinesAuthBackend, a runtimeProtocolwithcurrent_user(),can_read(resource)andcan_write(resource).core/auth/backends.pyshipsLocalAuthBackend, the permissive default. It readsHMP_USERthenUSER/USERNAMEthengetpass.getuser(), and answersTrueto every ACL check.core/auth/selection.pyexposesget_auth_backend(), which reads theHMP_AUTH_BACKENDenv var (or its argument) to pick an implementation. Unknown names raiseValueErrorso misspelt deployment configs fail loudly.
Wiring: results/catalog/audit.py:_resolve_actor and
cli/_workers/privacy.py:_purge_resolve_operator both centralise
actor resolution through get_auth_backend(). Auth lives in
core, so any layer may consume it; auth itself must not import
outside core.
Layer-matrix neighbours#
Allowed targets:
coreonly.Allowed sources: every other layer.
Any new sibling edge is a regression unless the YAML is updated with an explicit rationale.
See also#
config for the root that consumes the unit aliases and the
Profileenum.Layered Architecture for the matrix that pins
coreas the kernel leaf.Add a Config Field for the recipe that uses
Profileand the unit aliases.