Skip to content

Commit 1d0989e

Browse files
authored
Merge pull request #330 from joshmoore/zep9-ext-naming
2 parents 52610ba + 7ee6d31 commit 1d0989e

File tree

24 files changed

+944
-469
lines changed

24 files changed

+944
-469
lines changed

docs/conf.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,18 @@
8787

8888
redirects = {
8989
"index": "specs.html",
90+
"v3/core/v3.0.html": "./index.html",
91+
"v3/codecs/blosc/v1.0.rst": "./index.html",
92+
"v3/codecs/bytes/v1.0.rst": "./index.html",
93+
"v3/codecs/crc32c/v1.0.rst": "./index.html",
94+
"v3/codecs/gzip/v1.0.rst": "./index.html",
95+
"v3/codecs/sharding-indexed/v1.0.rst": "./index.html",
96+
"v3/codecs/transpose/v1.0.rst": "./index.html",
97+
"v3/stores/filesystem/v1.0.rst": "./index.html",
98+
"v3/chunk-grid.rst": "chunk-grids/index.rst",
99+
"v3/chunk-key-encoding.rst": "chunk-key-encodings/index.html",
100+
"v3/codecs.rst": "codecs/index.html",
101+
"v3/data-types.rst": "data-types/index.html",
102+
"v3/array-storage-transformers.rst": "storage-transformers/index.html",
103+
"v3/stores.rst": "stores/index.html",
90104
}

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Specs
33
=====
44

5-
A good starting point is the :ref:`zarr-core-specification-v3.0`.
5+
A good starting point is the :ref:`zarr-core-specification-v3`.
66

77
.. toctree::
88

docs/specs.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ Specifications
88
:maxdepth: 1
99
:caption: v3
1010

11-
Core <v3/core/v3.0>
12-
v3/data-types
13-
v3/codecs
14-
v3/stores
15-
v3/array-storage-transformers
11+
Core <v3/core/index>
12+
v3/codecs/index
13+
v3/chunk-grids/index
14+
v3/chunk-key-encodings/index
15+
v3/data-types/index
16+
v3/stores/index
17+
v3/storage-transformers/index
1618

1719
.. toctree::
1820
:maxdepth: 1

docs/v3/array-storage-transformers.rst

Lines changed: 0 additions & 13 deletions
This file was deleted.

docs/v3/chunk-grids/index.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.. _chunk-grid-list:
2+
3+
===========
4+
Chunk Grids
5+
===========
6+
7+
The following documents specify chunk grids which SHOULD
8+
be implemented by all implementations.
9+
10+
.. toctree::
11+
:glob:
12+
:maxdepth: 1
13+
:titlesonly:
14+
:caption: Contents:
15+
16+
*/*
17+
18+
Extensions
19+
----------
20+
21+
Registered chunk grid extensions can be found under
22+
`zarr-extensions::chunk-grids <https://github.com/zarr-developers/zarr-extensions/tree/main/chunk-grids>`_.
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
2+
.. _regular-chunkgrid:
3+
4+
==================
5+
Regular chunk grid
6+
==================
7+
8+
Version:
9+
1.0
10+
Specification URI:
11+
https://zarr-specs.readthedocs.io/en/latest/v3/chunk-grids/regular-grid/
12+
Corresponding ZEP:
13+
`ZEP0001 — Zarr specification version 3 <https://zarr.dev/zeps/draft/ZEP0001.html>`_
14+
Issue tracking:
15+
`GitHub issues <https://github.com/zarr-developers/zarr-specs/labels/chunk-grid>`_
16+
Suggest an edit for this spec:
17+
`GitHub editor <https://github.com/zarr-developers/zarr-specs/blob/main/docs/v3/chunk-grids/regular-grid/index.rst>`_
18+
19+
Copyright 2020-Present Zarr core development team. This work
20+
is licensed under a `Creative Commons Attribution 3.0 Unported License
21+
<https://creativecommons.org/licenses/by/3.0/>`_.
22+
23+
----
24+
25+
Abstract
26+
========
27+
28+
A regular grid is a type of grid where an array is divided into chunks
29+
such that each chunk is a hyperrectangle of the same shape. The
30+
dimensionality of the grid is the same as the dimensionality of the
31+
array. Each chunk in the grid can be addressed by a tuple of positive
32+
integers (`k`, `j`, `i`, ...) corresponding to the indices of the
33+
chunk along each dimension.
34+
35+
Description
36+
===========
37+
38+
The origin element of a chunk has coordinates in the array space (`k` *
39+
`dz`, `j` * `dy`, `i` * `dx`, ...) where (`dz`, `dy`, `dx`, ...) are
40+
the chunk sizes along each dimension.
41+
Thus the origin element of the chunk at grid index (0, 0, 0,
42+
...) is at coordinate (0, 0, 0, ...) in the array space, i.e., the
43+
grid is aligned with the origin of the array. If the length of any
44+
array dimension is not perfectly divisible by the chunk length along
45+
the same dimension, then the grid will overhang the edge of the array
46+
space.
47+
48+
The shape of the chunk grid will be (ceil(`z` / `dz`), ceil(`y` /
49+
`dy`), ceil(`x` / `dx`), ...) where (`z`, `y`, `x`, ...) is the array
50+
shape, "/" is the division operator and "ceil" is the ceiling
51+
function. For example, if a 3 dimensional array has shape (10, 200,
52+
3000), and has chunk shape (5, 20, 400), then the shape of the chunk
53+
grid will be (2, 10, 8), meaning that there will be 2 chunks along the
54+
first dimension, 10 along the second dimension, and 8 along the third
55+
dimension.
56+
57+
.. list-table:: Regular Grid Example
58+
:header-rows: 1
59+
60+
* - Array Shape
61+
- Chunk Shape
62+
- Chunk Grid Shape
63+
- Notes
64+
* - (10, 200, 3000)
65+
- (5, 20, 400)
66+
- (2, 10, 8)
67+
- The grid does overhang the edge of the array on the 3rd dimension.
68+
69+
An element of an array with coordinates (`c`, `b`, `a`, ...) will
70+
occur within the chunk at grid index (`c` // `dz`, `b` // `dy`, `a` //
71+
`dx`, ...), where "//" is the floor division operator. The element
72+
will have coordinates (`c` % `dz`, `b` % `dy`, `a` % `dx`, ...) within
73+
that chunk, where "%" is the modulo operator. For example, if a
74+
3 dimensional array has shape (10, 200, 3000), and has chunk shape
75+
(5, 20, 400), then the element of the array with coordinates (7, 150, 900)
76+
is contained within the chunk at grid index (1, 7, 2) and has coordinates
77+
(2, 10, 100) within that chunk.
78+
79+
The store key corresponding to a given grid cell is determined based on the
80+
:ref:`array-metadata-chunk-key-encoding` member of the :ref:`array-metadata`.
81+
82+
Note that this specification does not consider the case where the
83+
chunk grid and the array space are not aligned at the origin vertices
84+
of the array and the chunk at grid index (0, 0, 0, ...). However,
85+
extensions may define variations on the regular grid type
86+
such that the grid indices may include negative integers, and the
87+
origin element of the array may occur at an arbitrary position within
88+
any chunk, which is required to allow arrays to be extended by an
89+
arbitrary length in a "negative" direction along any dimension.
90+
91+
.. note:: Chunks at the border of an array always have the full chunk size, even when
92+
the array only covers parts of it. For example, having an array with ``"shape": [30, 30]`` and
93+
``"chunk_shape": [16, 16]``, the chunk ``0,1`` would also contain unused values for the indices
94+
``0-16, 30-31``. When writing such chunks it is recommended to use the current fill value
95+
for elements outside the bounds of the array.
96+
97+
98+
99+
Status of this document
100+
=======================
101+
102+
ZEP0001 was accepted on May 15th, 2023 via https://github.com/zarr-developers/zarr-specs/issues/227.
103+
104+
105+
Document conventions
106+
====================
107+
108+
Conformance requirements are expressed with a combination of
109+
descriptive assertions and [RFC2119]_ terminology. The key words
110+
"MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
111+
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in the normative
112+
parts of this document are to be interpreted as described in
113+
[RFC2119]_. However, for readability, these words do not appear in all
114+
uppercase letters in this specification.
115+
116+
All of the text of this specification is normative except sections
117+
explicitly marked as non-normative, examples, and notes. Examples in
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
.. _default-chunkkeyencoding:
2+
3+
==========================
4+
Default chunk key encoding
5+
==========================
6+
7+
Version:
8+
1.0
9+
Specification URI:
10+
https://zarr-specs.readthedocs.io/en/latest/v3/chunk-key-encodings/default/
11+
Corresponding ZEP:
12+
`ZEP0001 — Zarr specification version 3 <https://zarr.dev/zeps/draft/ZEP0001.html>`_
13+
Issue tracking:
14+
`GitHub issues <https://github.com/zarr-developers/zarr-specs/labels/chunk-grid>`_
15+
Suggest an edit for this spec:
16+
`GitHub editor <https://github.com/zarr-developers/zarr-specs/blob/main/docs/v3/chunk-key-encodings/default/index.rst>`_
17+
18+
Copyright 2020-Present Zarr core development team. This work
19+
is licensed under a `Creative Commons Attribution 3.0 Unported License
20+
<https://creativecommons.org/licenses/by/3.0/>`_.
21+
22+
----
23+
24+
Description
25+
===========
26+
27+
The ``configuration`` object may contain one optional member,
28+
``separator``, which must be either ``"/"`` or ``"."``. If not specified,
29+
``separator`` defaults to ``"/"``.
30+
31+
The key for a chunk with grid index (``k``, ``j``, ``i``, ...) is
32+
formed by taking the initial prefix ``c``, and appending for each dimension:
33+
34+
- the ``separator`` character, followed by,
35+
36+
- the ASCII decimal string representation of the chunk index within that dimension.
37+
38+
For example, in a 3 dimensional array, with a separator of ``/`` the identifier
39+
for the chunk at grid index (1, 23, 45) is the string ``"c/1/23/45"``. With a
40+
separator of ``.``, the identifier is the string ``"c.1.23.45"``. The initial prefix
41+
``c`` ensures that metadata documents and chunks have separate prefixes.
42+
43+
.. note:: A main difference with spec v2 is that the default chunk separator
44+
changed from ``.`` to ``/``, as in N5. This decreases the maximum number of
45+
items in hierarchical stores like directory stores.
46+
47+
.. note:: Arrays may have 0 dimensions (when for example representing scalars),
48+
in which case the coordinate of a chunk is the empty tuple, and the chunk key
49+
will consist of the string ``c``.
50+
51+
52+
Status of this document
53+
=======================
54+
55+
ZEP0001 was accepted on May 15th, 2023 via https://github.com/zarr-developers/zarr-specs/issues/227.
56+
57+
58+
Document conventions
59+
====================
60+
61+
Conformance requirements are expressed with a combination of
62+
descriptive assertions and [RFC2119]_ terminology. The key words
63+
"MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
64+
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in the normative
65+
parts of this document are to be interpreted as described in
66+
[RFC2119]_. However, for readability, these words do not appear in all
67+
uppercase letters in this specification.
68+
69+
All of the text of this specification is normative except sections
70+
explicitly marked as non-normative, examples, and notes. Examples in
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.. _chunk-key-encoding-list:
2+
3+
===================
4+
Chunk Key Encodings
5+
===================
6+
7+
The following documents specify chunk key encodings which SHOULD
8+
be implemented by all implementations.
9+
10+
.. toctree::
11+
:glob:
12+
:maxdepth: 1
13+
:titlesonly:
14+
:caption: Contents:
15+
16+
*/*
17+
18+
Extensions
19+
----------
20+
21+
Registered chunk grid extensions can be found under
22+
`zarr-extensions::chunk-key-encodings <https://github.com/zarr-developers/zarr-extensions/tree/main/chunk-key-encodings>`_.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
.. _v2-chunkkeyencoding:
2+
3+
=====================
4+
v2 chunk key encoding
5+
=====================
6+
7+
Version:
8+
1.0
9+
Specification URI:
10+
https://zarr-specs.readthedocs.io/en/latest/v3/chunk-key-encodings/v2/
11+
Corresponding ZEP:
12+
`ZEP0001 — Zarr specification version 3 <https://zarr.dev/zeps/draft/ZEP0001.html>`_
13+
Issue tracking:
14+
`GitHub issues <https://github.com/zarr-developers/zarr-specs/labels/chunk-grid>`_
15+
Suggest an edit for this spec:
16+
`GitHub editor <https://github.com/zarr-developers/zarr-specs/blob/main/docs/v3/chunk-key-encodings/v2/index.rst>`_
17+
18+
Copyright 2020-Present Zarr core development team. This work
19+
is licensed under a `Creative Commons Attribution 3.0 Unported License
20+
<https://creativecommons.org/licenses/by/3.0/>`_.
21+
22+
----
23+
24+
Description
25+
===========
26+
27+
The ``configuration`` object may contain one optional member,
28+
``separator``, which must be either ``"/"`` or ``"."``. If not specified,
29+
``separator`` defaults to ``"."``.
30+
31+
The identifier for chunk with at least one dimension is formed by
32+
concatenating for each dimension:
33+
34+
- the ASCII decimal string representation of the chunk index within that
35+
dimension, followed by
36+
37+
- the ``separator`` character, except that it is omitted for the last
38+
dimension.
39+
40+
For example, in a 3 dimensional array, with a separator of ``.`` the identifier
41+
for the chunk at grid index (1, 23, 45) is the string ``"1.23.45"``. With a
42+
separator of ``/``, the identifier is the string ``"1/23/45"``.
43+
44+
For chunk grids with 0 dimensions, the single chunk has the key ``"0"``.
45+
46+
.. warning::
47+
48+
This encoding is intended only to allow existing v2 arrays to be
49+
converted to v3 without having to rename chunks. It is not recommended
50+
to be used when writing new arrays.
51+
52+
53+
Status of this document
54+
=======================
55+
56+
ZEP0001 was accepted on May 15th, 2023 via https://github.com/zarr-developers/zarr-specs/issues/227.
57+
58+
59+
Document conventions
60+
====================
61+
62+
Conformance requirements are expressed with a combination of
63+
descriptive assertions and [RFC2119]_ terminology. The key words
64+
"MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
65+
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in the normative
66+
parts of this document are to be interpreted as described in
67+
[RFC2119]_. However, for readability, these words do not appear in all
68+
uppercase letters in this specification.
69+
70+
All of the text of this specification is normative except sections
71+
explicitly marked as non-normative, examples, and notes. Examples in

docs/v3/codecs.rst

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)