hydromodpy.results.parquet_schemas#

PyArrow schemas for every per-simulation Parquet view.

One declared pa.Schema per file under simulations/<basename>.parquet/. These schemas are the single source of truth for column names, Arrow types, nullability, primary keys, and field-level metadata (units, descriptions, allowed values). The catalog write path casts incoming records to the matching schema before handing them to hydromodpy.results.parquet_io.write_table_atomic().

Schema-level metadata embeds hmp.schema, hmp.schema_version, hmp.pk and CF Conventions. Per-field metadata documents the physical unit and a short description. PARQUET_SCHEMA_VERSION is bumped to v2 and rejected at read time when a Parquet file ships an older marker.

Module attributes

PARQUET_SCHEMA_VERSION

Current Parquet schema generation.

CF_CONVENTIONS

CF convention version embedded in schema metadata.

TIMESERIES_SCHEMA

Per-simulation timeseries observations and outputs.

BUDGETS_SCHEMA

Per-simulation water budget per zone and component.

MASS_BALANCE_SCHEMA

Per-simulation global mass balance summary (water and solute budgets).

METRICS_SCHEMA

Per-simulation calibration and validation metrics.

PROVENANCE_SCHEMA

Per-simulation provenance records for inputs and derived arrays.

GEOGRAPHIC_FEATURES_SCHEMA

Logical schema of the GeoParquet 1.1 vector files.

VIEW_SCHEMAS

Map of per-simulation view name to declared pa.Schema.

Functions

check_schema_version(metadata)

Raise ParquetSchemaVersionError if hmp.schema_version differs.

schema_for(view_name)

Return the declared pa.Schema for view_name.

Exceptions

ParquetSchemaVersionError

Raised when a Parquet file ships an unsupported hmp.schema_version.