pydata / xarray

N-D labeled arrays and datasets in Python
https://xarray.dev
Apache License 2.0
3.63k stars 1.09k forks source link

Zarr V3 support: use `dimension_names` array metadata rather than user attribute `_ARRAY_DIMENSIONS` #9668

Closed rabernat closed 4 weeks ago

rabernat commented 4 weeks ago

What is your issue?

Zarr V3 now explicitly supports dimension names on arrays (see Array API docs.

This makes our _ARRAY_DIMENSIONS special attribute unnecessary. https://github.com/pydata/xarray/blob/b133fdca71fd614b8056c3e995062b2834320ba5/xarray/backends/zarr.py#L54-L55

However, we are still using _ARRAY_DIMENSIONS with V3 in Xarray.

It would be great to fix this before we release V3 support so we don't start putting V3 data out into wild with this attribute set.