|
3 | 3 | ========================================== |
4 | 4 | Sharding codec (version 1.0) |
5 | 5 | ========================================== |
6 | | ------------------------------ |
7 | | - Editor's draft 23 03 2023 |
8 | | ------------------------------ |
| 6 | + |
| 7 | + **Editor's draft 17 July 2023** |
9 | 8 |
|
10 | 9 | Specification URI: |
11 | 10 | https://zarr-specs.readthedocs.io/en/latest/v3/codecs/sharding-indexed/v1.0.html |
12 | | - |
| 11 | +Corresponding ZEP: |
| 12 | + `ZEP 2 — Sharding codec <https://zarr.dev/zeps/draft/ZEP0002.html>`_ |
13 | 13 | Issue tracking: |
14 | 14 | `GitHub issues <https://github.com/zarr-developers/zarr-specs/labels/sharding-indexed-codec-v1.0>`- |
15 | | - |
16 | 15 | Suggest an edit for this spec: |
17 | 16 | `GitHub editor <https://github.com/zarr-developers/zarr-specs/blob/main/docs/codecs/sharding-indexed/v1.0.rst>`_ |
18 | 17 |
|
@@ -188,13 +187,13 @@ beyond the array shape. |
188 | 187 | The index is placed at the end of the file and encoded into binary representations |
189 | 188 | using the specified index codecs. The byte size of the index is determined by the |
190 | 189 | number of inner chunks in the shard ``n``, i.e. the product of the sizes specified in |
191 | | -``chunk_shape``, and the choice of index codecs. For a combination of little-endian |
192 | | -codec and crc32c checksum codec, the index has a size of ``16 * n + 4``. For example, |
193 | | -``16 * 4 + 4 = 68 bytes`` for a shard shape of ``[64, 64]`` and inner chunk shape of |
194 | | -``[32, 32]``. |
| 190 | +``chunk_shape``, and the choice of index codecs. |
195 | 191 |
|
196 | | -Given the example of 2x2 inner chunks in a shard and recommended index codecs, i.e. |
197 | | -little-endian codec followed by crc32c checksum codec, the index would look like:: |
| 192 | +For an example, consider a shard shape of ``[64, 64]``, an inner chunk shape of |
| 193 | +``[32, 32]`` and an index codec combination of a little-endian codec followed by |
| 194 | +a crc32c checksum codec. The size of the corresponding index is |
| 195 | +``16 (2x uint64) * 4 (chunks per shard) + 4 (crc32c checksum) = 68 bytes``. |
| 196 | +The index would look like:: |
198 | 197 |
|
199 | 198 | | chunk (0, 0) | chunk (0, 1) | chunk (1, 0) | chunk (1, 1) | | |
200 | 199 | | offset | nbytes | offset | nbytes | offset | nbytes | offset | nbytes | checksum | |
|
0 commit comments