pandera.api.xarray.components.DataVarΒΆ
- class pandera.api.xarray.components.DataVar(*, required=True, alias=None, regex=False, default=None, aligned_with=None, broadcastable_with=None, dtype=None, dims=None, ordered_dims=True, sizes=None, shape=None, coords=None, attrs=None, name=None, checks=None, parsers=None, coerce=False, nullable=False, chunked=None, array_type=None, encoding=None, strict_coords=False, strict_attrs=False, title=None, description=None, metadata=None)[source]ΒΆ
Per-variable schema inside
DatasetSchema.aligned_with/broadcastable_withexpress grid relationships to other data variables (same shape vs broadcastable). Other fields mirrorDataArraySchema(dims, dtype, checks, etc.).ParametersΒΆ
- required
If False, the variable may be absent;
defaultcan fill it.- alias
Actual name in the
Datasetif different from the key.- default
Filled when
required=Falseand the variable is missing.- aligned_with
Names of variables that must share dims and shape with this one.
- broadcastable_with
Names of variables this one must be broadcastable against (see backend).
- dtype, dims, sizes, shape, coords, attrs
Structural constraints (
sizesandshapeare mutually exclusive).- checks, parsers, coerce, nullable, chunked, array_type
Same roles as on
DataArraySchema.- encoding
Expected per-variable encoding key-value pairs (e.g.
_FillValue,scale_factor,add_offset,dtype,zlib,complevel). Validated againstds[var_name].encoding, which is populated when reading from netCDF/Zarr. Can be adict[str, Any]or apydantic.BaseModelclass for structured validation.- strict_coords, strict_attrs
Coordinate / attribute strictness for the variable array.
- name, title, description, metadata
Documentation / identification metadata.
Methods
- __init__(*, required=True, alias=None, regex=False, default=None, aligned_with=None, broadcastable_with=None, dtype=None, dims=None, ordered_dims=True, sizes=None, shape=None, coords=None, attrs=None, name=None, checks=None, parsers=None, coerce=False, nullable=False, chunked=None, array_type=None, encoding=None, strict_coords=False, strict_attrs=False, title=None, description=None, metadata=None)[source]ΒΆ