Schema

ColumnSpec

class climagrid.schema.ColumnSpec(**data)[source]

Bases: BaseModel

Parameters:
model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: str
dtype: str
units: str
description: str
source: str
nullable: bool

Utility functions

climagrid.schema.validate_dataframe(df, required_sources=None)[source]

Return a list of validation errors (empty = valid).

Return type:

list[str]

Parameters:
climagrid.schema.schema_summary()[source]

Return a human-readable summary of the full schema.

Return type:

DataFrame

climagrid.schema.empty_dataframe()[source]

Return an empty DataFrame with all index columns present.

Return type:

DataFrame

Column lists

The following module-level lists are exported for programmatic use:

from climagrid.schema import (
    ALL_COLUMNS,       # all 34 ColumnSpec objects
    COLUMN_MAP,        # dict[name, ColumnSpec]
    INDEX_COLUMNS,
    NOAA_HRRR_COLUMNS,
    NASA_POWER_COLUMNS,
    NOAA_NCEI_COLUMNS,
    USDA_NRCS_COLUMNS,
    USFS_WFIGS_COLUMNS,
    FEATURE_COLUMNS,
)