You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/internals/zarr-encoding-spec.rst
+8-11Lines changed: 8 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,9 +43,9 @@ When accessing arrays with zarr-python, this information is available in the arr
43
43
metadata but not in the attributes dictionary.
44
44
45
45
When reading a Zarr group, Xarray looks for dimension information in the appropriate
46
-
location based on the format version, raising an error if it can't be found. The
46
+
location based on the inferred format version, raising an error if it can't be found. The
47
47
dimension information is used to define the variable dimension names and then
48
-
(for Zarr V2) removed from the attributes dictionary returned to the user.
48
+
(for Zarr V2) is removed from the attributes dictionary returned to the user.
49
49
50
50
CF Conventions
51
51
--------------
@@ -59,17 +59,14 @@ used to describe metadata in NetCDF and Zarr.
59
59
Compatibility and Reading
60
60
-------------------------
61
61
62
-
Because of these encoding choices, Xarray cannot read arbitrary Zarr arrays, but only
63
-
Zarr data with valid dimension metadata. Xarray supports:
62
+
Because of these encoding choices, Xarray cannot read arbitrary Zarr groups, but only
63
+
Zarr groups containing arrays with valid dimension metadata. Xarray supports:
64
64
65
-
- Zarr V2 arrays with ``_ARRAY_DIMENSIONS`` attributes
66
-
- Zarr V3 arrays with ``dimension_names`` metadata
67
-
- `NCZarr <https://docs.unidata.ucar.edu/nug/current/nczarr_head.html>`_ format
68
-
(dimension names are defined in the ``.zarray`` file)
65
+
1. Zarr V3 arrays with ``dimension_names`` metadata
66
+
2. Zarr V2 arrays with ``_ARRAY_DIMENSIONS`` attributes
67
+
3. `NCZarr <https://docs.unidata.ucar.edu/nug/current/nczarr_head.html>`_ format (dimension names are defined in the ``dimrefs`` field in the custom ``.zarray`` file)
69
68
70
-
After decoding the dimension information and assigning the variable dimensions,
71
-
Xarray proceeds to [optionally] decode each variable using its standard CF decoding
72
-
machinery used for NetCDF data.
69
+
Xarray checks each of these three conventions, in the order given above, when looking for dimension name metadata. Note that while Xarray can read NCZarr groups, it currently does not write NCZarr groups. After decoding the dimension information and assigning the variable dimensions, Xarray proceeds to [optionally] decode each variable using its standard CF decoding machinery used for NetCDF data.
73
70
74
71
Finally, it's worth noting that Xarray writes (and attempts to read)
75
72
"consolidated metadata" by default (the ``.zmetadata`` file), which is another
Copy file name to clipboardExpand all lines: doc/whats-new.rst
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,8 @@ Deprecations
26
26
Bug Fixes
27
27
~~~~~~~~~
28
28
29
+
- Slightly amend `Xarray's Zarr Encoding Specification doc <https://docs.xarray.dev/en/latest/internals/zarr-encoding-spec.html>`_ for clarity, and provide a code comment in ``xarray.backends.zarr._get_zarr_dims_and_attrs`` referencing the doc (:issue:`8749` :pull:`11013`).
30
+
By `Ewan Short <https://github.com/eshort0401>`_.
29
31
- Fix silent data corruption when writing dask arrays to sharded Zarr stores.
30
32
Dask chunk boundaries must now align with shard boundaries, not just internal
0 commit comments