Skip to content

config

Pydantic models for pipeline configuration. Load a config with PipelineConfig.from_yaml.

The source field accepts either an XarraySourceConfig or an IntakeSourceConfig, selected by the type discriminator field.

gridstats.config.XarraySourceConfig

Bases: _BaseSourceConfig

Load data with xarray (local files, cloud storage, any xarray engine).

gridstats.config.IntakeSourceConfig

Bases: _BaseSourceConfig

Load data from an intake-forecast catalog.

gridstats.config.OutputConfig

Bases: BaseModel

Configuration for pipeline output.

gridstats.config.ClusterConfig

Bases: BaseModel

Dask cluster configuration.

Defaults are tuned for cloud environments where CPUs are virtual (hyperthreaded). threads_per_worker=2 maps two vCPUs to one worker process (one physical core's worth of compute), giving fewer workers with more memory each — important for memory-intensive operations like quantile.

gridstats.config.CallConfig

Bases: BaseModel

Configuration for a single stat call.

Any extra fields are forwarded as keyword arguments to the stat function.

extra_kwargs() -> dict[str, Any]

Return function-specific kwargs (all fields beyond the base schema).

gridstats.config.PipelineConfig

Bases: BaseModel

Top-level pipeline configuration.

from_yaml(path: str | Path) -> PipelineConfig classmethod

Load and validate a pipeline config from a YAML file.