XarrayΒΆ

New in 0.31.0

Schemas and components for validating xarray.DataArray, xarray.Dataset, and xarray.DataTree. Typical imports use pandera.xarray; implementations live under pandera.api.xarray. See Xarray Data Validation for usage examples.

The pandera.xarray entry point also re-exports Check, Parser, the decorators (check_input(), etc.), and pandera.errors β€” see Core for those APIs.

SchemasΒΆ

pandera.api.xarray.container.DataArraySchema

A lightweight xarray DataArray validator.

pandera.api.xarray.container.DatasetSchema

A lightweight xarray Dataset validator.

pandera.api.xarray.container.DataTreeSchema

Validate an xarray.DataTree.

Schema componentsΒΆ

pandera.api.xarray.components.DataVar

Per-variable schema inside DatasetSchema.

pandera.api.xarray.components.Coordinate

Specification for one entry in DataArraySchema(coords=...).

Declarative modelsΒΆ

pandera.api.xarray.model_components.Field

Field specification for xarray models (mirrors dataframe Field()).

TypingΒΆ

pandera.typing.xarray.Coordinate

Mark a field on DataArrayModel or DatasetModel as a coordinate schema.

pandera.typing.xarray.DataArray

Annotation-only generic for xarray.DataArray.

pandera.typing.xarray.Dataset

Annotation-only generic for xarray.Dataset.

pandera.typing.xarray.DataTree

Annotation-only generic for xarray.DataTree.

pandera.typing.xarray.XarrayAnnotationBase

Marker base for pandera xarray annotation types.

Model configurationΒΆ

Abstract base classesΒΆ

pandera.api.xarray.base.BaseDataArraySchema

Base class for xarray DataArray schemas.

pandera.api.xarray.base.BaseDatasetSchema

Base class for xarray Dataset schemas.

pandera.api.xarray.base.BaseDataTreeSchema

Base class for xarray DataTree schemas.

Check object typesΒΆ

Types accepted by xarray Check backends and the XARRAY_CHECK_OBJECT_TYPES registry tuple.

pandera.api.xarray.types.XarrayData

Container passed to Check backends.

pandera.api.xarray.types.XARRAY_CHECK_OBJECT_TYPES

Built-in immutable sequence.

pandera.api.xarray.types.XarrayCheckObjects

Built-in immutable sequence.

ConfigurationΒΆ

See also Core for the full configuration API.

pandera.config.ValidationDepth

Whether to apply checks at schema- or data-level, or both.

pandera.config.ValidationScope

Indicates whether a check/validator operates at a schema of data level.

UtilitiesΒΆ

pandera.api.xarray.utils.get_validation_depth

Resolve ValidationDepth for an xarray object.

Schema inferenceΒΆ

pandera.schema_inference.xarray.infer_schema

Infer schema for an xarray DataArray or Dataset.

IO (YAML / JSON)ΒΆ

Serialization helpers for xarray schemas (also re-exported from pandera.xarray).

pandera.io.xarray_io.to_yaml

Write a DataArraySchema or DatasetSchema to yaml.

pandera.io.xarray_io.from_yaml

Create a DataArraySchema or DatasetSchema from yaml.

pandera.io.xarray_io.to_json

Write a DataArraySchema or DatasetSchema to json.

pandera.io.xarray_io.from_json

Create a DataArraySchema or DatasetSchema from json.

Hypothesis strategiesΒΆ

Hypothesis strategies for generating DataArray / Dataset objects that match a schema. Requires the strategies extra.

DtypesΒΆ

See Data Types for DataType and Engine.

See alsoΒΆ