Skip to content

Commit 0b3bf13

Browse files
committed
v2 spec: add optional dimension_separator (see zarr-developers#707)
Various implementations allow for defining the separator between the dimension indexes when writing chunks: * n5-zarr defines a `dimensionSeparator` parameter; * zarr-python's NestedDirectoryStore does so by default * and FSStore provides a `key_separator` parameter; * tensorstore has a `key_encoding` parameter; and * jzarr is looking to add the same functionality. When writing an array, it is straight-forward to set this separator and have arrays properly configured. Consumers of such arrays, however, must either know *a priori* if their arrays use a non-default separator or must loop through all possible chunks keys searching for the right one. By defining adding an optional metadata key to the .zarray, we: * preserve the efficient configuration of arrays * while keeping the v2 spec backwards compatible. The primary downsides are that this will be the first optional metadata value in the v2 spec and therefore we don't have a strong understanding of how that will play out, and datasets which were previously written with non-default separators will need updating in order to enable the detection though that is no worse than the current situation.
1 parent 17728e8 commit 0b3bf13

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎docs/spec/v2.rst‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ filters
7878
filters are to be applied. Each codec configuration object MUST contain a
7979
``"id"`` key identifying the codec to be used.
8080

81+
The following keys MAY be present within the object:
82+
83+
dimension_separator
84+
A string, optimally of length 1, which defines the separator placed
85+
between the dimensions of a chunk. If the value is not set, then the
86+
default MUST be assumed to ``"."``, leading to chunk keys of the form "0.0".
87+
The most common non-default value is ``"/"``, which leads to nested keys of
88+
the form "0/0" that in most implementations produces a directory structure.
89+
8190
Other keys MUST NOT be present within the metadata object.
8291

8392
For example, the JSON object below defines a 2-dimensional array of 64-bit

0 commit comments

Comments
 (0)