xarray-dataclasses icon indicating copy to clipboard operation
xarray-dataclasses copied to clipboard

Add type hint for attribute"s" field

Open astropenguin opened this issue 3 years ago • 0 comments

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.

astropenguin avatar Mar 28 '22 17:03 astropenguin