data#
hydromodpy.data orchestrates input data acquisition, validation,
and integration. Seventeen variables share the same Variable / Manager
/ Source pattern, with a DuckDB cache that records every fetched
artefact for cache-hit detection and reproducibility.
Sub-modules#
data/base_manager_variable.py–BaseVariableManagerABC for point variables (gauges, observations).data/base_manager_field.py–BaseFieldManagerABC for field variables (rasters, gridded forcing).data/_base_manager_common.py– shared cache and persistence logic.data/sources.py– source registry with@register_sourcedecorator andget_source(variable_type, source_name)lookup.data/planner.pyanddata/plan.py–DataPlannerand immutableDataLoadPlan. The planner merges[data].typeswith rules that infer extra variables from foreign sections (for example geology ifdomain.zone_idsmentions geology).data/registry/catalog_duckdb.py–DataCatalogDuckDBpersisting (variable, source, station_id, bbox, dates, file_path, mtime, sha256) for cache hits and external-mod detection.data/contracts/– record types:PointRecord,FieldRecord,LoadResult,StationLocation.data/adapters/– bridges to other layers (geology, station sets).data/common/– shared helpers (timezone, units, geometry).data/schemas/– Pydantic models reused across variables.data/variables/– one folder per variable.
Variable inventory#
Seventeen variables ship today, each in its own folder under
data/variables/:
Variable |
Sources |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LoadResult contract#
Every manager returns a LoadResult:
PointRecord:station_id,variable,source,unit,frequency,data(datetime-indexed DataFrame),date_start/date_end,location(StationLocation),source_unit.FieldRecord:variable,source,field_path,crs,shape,metadata.
Key public symbols#
hydromodpy.data.base_manager_variable.BaseVariableManagerhydromodpy.data.base_manager_field.BaseFieldManagerhydromodpy.data.sources.{register_source, get_source, list_sources}hydromodpy.data.planner.DataPlannerhydromodpy.data.plan.DataLoadPlanhydromodpy.data.registry.catalog_duckdb.DataCatalogDuckDBhydromodpy.data.contracts.results.LoadResulthydromodpy.data.contracts.records.{PointRecord, FieldRecord}
Recommended reading path#
hydromodpy/data/README.mdhydromodpy/data/base_manager_variable.pyhydromodpy/data/sources.pyfor the registration model.hydromodpy/data/variables/hydrometry/for a complete point variable.hydromodpy/data/variables/dem/for a complete field variable.hydromodpy/data/planner.pyfor the inference rules.hydromodpy/data/registry/catalog_duckdb.pyfor the cache schema.
Layer-matrix neighbours#
Allowed targets:
core,schema,data,spatial.Documented tolerance:
data->resultsfor the read-only cross-DB ATTACH bridge.Allowed sources:
simulation,calibration,analysis,config,workflow,catalog,projectandcli.
See also#
Add a Data Variable and Add a Data Source for contributor recipes.
Data Loading And Retrieval for the user-facing data loading guide and provider matrix.