xarray-dataclasses
xarray-dataclasses copied to clipboard
Add type hint for attribute"s" field
Add type hint Attrs for attributes of DataArray or Dataset:
@dataclass
class Image(AsDataArray):
"""2D image as DataArray."""
data: Data[X, Y, float]
x: Coord[X, int] = 0
y: Coord[Y, int] = 0
attrs: Attrs[dict[str, Any]] = field(default_factory=dict)
Note that this different from Attr, which is for an entry in attributes.