Skip to content

Commit d31dab3

Browse files
committed
Move notes regrading automatic shuffle selection out of zarr v2 comparison section
1 parent cd9912a commit d31dab3

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

docs/v3/codecs/blosc/v1.0.rst

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,20 @@ shuffle:
7777
- ``"shuffle"``, to indicate byte-wise shuffling;
7878
- ``"bitshuffle"``, to indicate bit-wise shuffling.
7979

80+
Zarr implementations MAY provide users an option to choose a shuffle mode
81+
automatically based on the typesize or other information, but MUST record in
82+
the metadata the mode that is chosen.
83+
8084
typesize:
8185
Positive integer specifying the stride in bytes over which shuffling is
8286
performed. Required unless ``shuffle`` is ``"noshuffle"``, in which case the value
8387
is ignored.
8488

89+
Zarr implementations MAY allow users to leave this unspecified and have the
90+
implementation choose a value automatically based on the array data type and
91+
previous codecs in the chain, but MUST record in the metadata the value that
92+
is chosen.
93+
8594
blocksize:
8695
An integer giving the size in bytes of blocks into which a
8796
buffer is divided before compression. A value of 0
@@ -126,21 +135,15 @@ by the Zarr v2 ``blosc`` codec in the following ways:
126135
- The `shuffle` mode is now specified more clearly as `noshuffle` (0 in Zarr v2),
127136
`"bitshuffle"` (2 in Zarr v2), or `"shuffle"` (1 in Zarr v2). Using these constants
128137
rather than numbers makes it much easier to know what shuffle mode will be
129-
using from manual inspection of the metadata.
138+
used from manual inspection of the metadata.
130139

131140
- When shuffling is enabled, the `typesize` must now be specified explicitly in
132141
the metadata, rather than determined implicitly from the input data. This
133142
allows Blosc to function as a pure "bytes -> bytes" codec rather than an
134-
"array -> bytes" codec. Zarr implementations MAY allow users to leave this
135-
unspecified and have the implementation choose a value automatically based on
136-
the array data type and previous codecs in the chain, but MUST record in the
137-
metadata the value that is chosen.
143+
"array -> bytes" codec.
138144

139145
- There is no option to choose between bit-wise and byte-wise shuffling
140-
automatically, as supported in Zarr v2 via a `shuffle` value of `-1`. Zarr
141-
implementations MAY provide users an option to choose a shuffle mode
142-
automatically based on the typesize or other information, but MUST record in
143-
the metadata the mode that is chosen.
146+
automatically, as supported in Zarr v2 via a `shuffle` value of `-1`.
144147

145148
References
146149
==========

0 commit comments

Comments
 (0)