Skip to content

Commit 5c6267e

Browse files
authored
Consistent use of 'Zarr format 2 or 3' (#2645)
1 parent ec014f6 commit 5c6267e

File tree

14 files changed

+157
-157
lines changed

14 files changed

+157
-157
lines changed

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Zarr-Python
2525

2626
Zarr-Python is a Python library for reading and writing Zarr groups and arrays. Highlights include:
2727

28-
* Specification support for both Zarr v2 and v3.
28+
* Specification support for both Zarr format 2 and 3.
2929
* Create and read from N-dimensional arrays using NumPy-like semantics.
3030
* Flexible storage enables reading and writing from local, cloud and in-memory stores.
3131
* High performance: Enables fast I/O with support for asynchronous I/O and multi-threading.

docs/user-guide/extending.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Custom codecs
1010
-------------
1111

1212
.. note::
13-
This section explains how custom codecs can be created for Zarr version 3 data. For Zarr
14-
version 2, codecs should subclass the
13+
This section explains how custom codecs can be created for Zarr format 3 arrays. For Zarr
14+
format 2, codecs should subclass the
1515
`numcodecs.abc.Codec <https://numcodecs.readthedocs.io/en/stable/abc.html#numcodecs.abc.Codec>`_
1616
base class and register through
1717
`numcodecs.registry.register_codec <https://numcodecs.readthedocs.io/en/stable/registry.html#numcodecs.registry.register_codec>`_.
@@ -66,7 +66,7 @@ strongly recommended to prefix the codec identifier with a unique name. For exam
6666
the codecs from ``numcodecs`` are prefixed with ``numcodecs.``, e.g. ``numcodecs.delta``.
6767

6868
.. note::
69-
Note that the extension mechanism for the Zarr version 3 is still under development.
69+
Note that the extension mechanism for the Zarr format 3 is still under development.
7070
Requirements for custom codecs including the choice of codec identifiers might
7171
change in the future.
7272

docs/user-guide/v3_migration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Zarr-Python 3 represents a major refactor of the Zarr-Python codebase. Some of the
55
goals motivating this refactor included:
66

7-
* adding support for the Zarr V3 specification (along with the Zarr V2 specification)
7+
* adding support for the Zarr format 3 specification (along with the Zarr format 2 specification)
88
* cleaning up internal and user facing APIs
99
* improving performance (particularly in high latency storage environments like
1010
cloud object stores)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ filterwarnings = [
380380
"ignore:The loop argument is deprecated since Python 3.8.*:DeprecationWarning",
381381
"ignore:Creating a zarr.buffer.gpu.*:UserWarning",
382382
"ignore:Duplicate name:UserWarning", # from ZipFile
383-
"ignore:.*is currently not part in the Zarr version 3 specification.*:UserWarning",
383+
"ignore:.*is currently not part in the Zarr format 3 specification.*:UserWarning",
384384
]
385385
markers = [
386386
"gpu: mark a test as requiring CuPy and GPU"

src/zarr/api/asynchronous.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ async def consolidate_metadata(
198198

199199
if any(m.zarr_format == 3 for m in members_metadata.values()):
200200
warnings.warn(
201-
"Consolidated metadata is currently not part in the Zarr version 3 specification. It "
201+
"Consolidated metadata is currently not part in the Zarr format 3 specification. It "
202202
"may not be supported by other zarr implementations and may change in the future.",
203203
category=UserWarning,
204204
stacklevel=1,
@@ -770,16 +770,16 @@ async def open_group(
770770
Whether to use consolidated metadata.
771771
772772
By default, consolidated metadata is used if it's present in the
773-
store (in the ``zarr.json`` for Zarr v3 and in the ``.zmetadata`` file
774-
for Zarr v2).
773+
store (in the ``zarr.json`` for Zarr format 3 and in the ``.zmetadata`` file
774+
for Zarr format 2).
775775
776776
To explicitly require consolidated metadata, set ``use_consolidated=True``,
777777
which will raise an exception if consolidated metadata is not found.
778778
779779
To explicitly *not* use consolidated metadata, set ``use_consolidated=False``,
780780
which will fall back to using the regular, non consolidated metadata.
781781
782-
Zarr v2 allowed configuring the key storing the consolidated metadata
782+
Zarr format 2 allowed configuring the key storing the consolidated metadata
783783
(``.zmetadata`` by default). Specify the custom key as ``use_consolidated``
784784
to load consolidated metadata from a non-default key.
785785
@@ -870,21 +870,21 @@ async def create(
870870
Array shape.
871871
chunks : int or tuple of ints, optional
872872
The shape of the array's chunks.
873-
V2 only. V3 arrays should use `chunk_shape` instead.
873+
Zarr format 2 only. Zarr format 3 arrays should use `chunk_shape` instead.
874874
If not specified, default values are guessed based on the shape and dtype.
875875
dtype : str or dtype, optional
876876
NumPy dtype.
877877
chunk_shape : int or tuple of ints, optional
878878
The shape of the Array's chunks (default is None).
879-
V3 only. V2 arrays should use `chunks` instead.
879+
Zarr format 3 only. Zarr format 2 arrays should use `chunks` instead.
880880
chunk_key_encoding : ChunkKeyEncoding, optional
881881
A specification of how the chunk keys are represented in storage.
882-
V3 only. V2 arrays should use `dimension_separator` instead.
882+
Zarr format 3 only. Zarr format 2 arrays should use `dimension_separator` instead.
883883
Default is ``("default", "/")``.
884884
codecs : Sequence of Codecs or dicts, optional
885885
An iterable of Codec or dict serializations of Codecs. The elements of
886886
this collection specify the transformation from array values to stored bytes.
887-
V3 only. V2 arrays should use ``filters`` and ``compressor`` instead.
887+
Zarr format 3 only. Zarr format 2 arrays should use ``filters`` and ``compressor`` instead.
888888
889889
If no codecs are provided, default codecs will be used:
890890
@@ -895,7 +895,7 @@ async def create(
895895
These defaults can be changed by modifying the value of ``array.v3_default_codecs`` in :mod:`zarr.core.config`.
896896
compressor : Codec, optional
897897
Primary compressor to compress chunk data.
898-
V2 only. V3 arrays should use ``codecs`` instead.
898+
Zarr format 2 only. Zarr format 3 arrays should use ``codecs`` instead.
899899
900900
If neither ``compressor`` nor ``filters`` are provided, a default compressor will be used:
901901
@@ -925,7 +925,7 @@ async def create(
925925
for storage of both chunks and metadata.
926926
filters : sequence of Codecs, optional
927927
Sequence of filters to use to encode chunk data prior to compression.
928-
V2 only. If no ``filters`` are provided, a default set of filters will be used.
928+
Zarr format 2 only. If no ``filters`` are provided, a default set of filters will be used.
929929
These defaults can be changed by modifying the value of ``array.v2_default_filters`` in :mod:`zarr.core.config`.
930930
cache_metadata : bool, optional
931931
If True, array configuration metadata will be cached for the
@@ -942,7 +942,7 @@ async def create(
942942
A codec to encode object arrays, only needed if dtype=object.
943943
dimension_separator : {'.', '/'}, optional
944944
Separator placed between the dimensions of a chunk.
945-
V2 only. V3 arrays should use ``chunk_key_encoding`` instead.
945+
Zarr format 2 only. Zarr format 3 arrays should use ``chunk_key_encoding`` instead.
946946
Default is ".".
947947
write_empty_chunks : bool, optional
948948
Deprecated in favor of the ``config`` keyword argument.

src/zarr/api/synchronous.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -502,16 +502,16 @@ def open_group(
502502
Whether to use consolidated metadata.
503503
504504
By default, consolidated metadata is used if it's present in the
505-
store (in the ``zarr.json`` for Zarr v3 and in the ``.zmetadata`` file
506-
for Zarr v2).
505+
store (in the ``zarr.json`` for Zarr format 3 and in the ``.zmetadata`` file
506+
for Zarr format 2).
507507
508508
To explicitly require consolidated metadata, set ``use_consolidated=True``,
509509
which will raise an exception if consolidated metadata is not found.
510510
511511
To explicitly *not* use consolidated metadata, set ``use_consolidated=False``,
512512
which will fall back to using the regular, non consolidated metadata.
513513
514-
Zarr v2 allowed configuring the key storing the consolidated metadata
514+
Zarr format 2 allows configuring the key storing the consolidated metadata
515515
(``.zmetadata`` by default). Specify the custom key as ``use_consolidated``
516516
to load consolidated metadata from a non-default key.
517517
@@ -785,16 +785,16 @@ def create_array(
785785
Iterable of filters to apply to each chunk of the array, in order, before serializing that
786786
chunk to bytes.
787787
788-
For Zarr v3, a "filter" is a codec that takes an array and returns an array,
788+
For Zarr format 3, a "filter" is a codec that takes an array and returns an array,
789789
and these values must be instances of ``ArrayArrayCodec``, or dict representations
790790
of ``ArrayArrayCodec``.
791791
If ``filters`` and ``compressors`` are not specified, then the default codecs for
792-
Zarr v3 will be used.
792+
Zarr format 3 will be used.
793793
These defaults can be changed by modifying the value of ``array.v3_default_codecs``
794794
in :mod:`zarr.core.config`.
795795
Use ``None`` to omit default filters.
796796
797-
For Zarr v2, a "filter" can be any numcodecs codec; you should ensure that the
797+
For Zarr format 2, a "filter" can be any numcodecs codec; you should ensure that the
798798
the order if your filters is consistent with the behavior of each filter.
799799
If no ``filters`` are provided, a default set of filters will be used.
800800
These defaults can be changed by modifying the value of ``array.v2_default_filters``
@@ -804,32 +804,32 @@ def create_array(
804804
List of compressors to apply to the array. Compressors are applied in order, and after any
805805
filters are applied (if any are specified).
806806
807-
For Zarr v3, a "compressor" is a codec that takes a bytestrea, and
808-
returns another bytestream. Multiple compressors my be provided for Zarr v3.
807+
For Zarr format 3, a "compressor" is a codec that takes a bytestream, and
808+
returns another bytestream. Multiple compressors my be provided for Zarr format 3.
809809
If ``filters`` and ``compressors`` are not specified, then the default codecs for
810-
Zarr v3 will be used.
810+
Zarr format 3 will be used.
811811
These defaults can be changed by modifying the value of ``array.v3_default_codecs``
812812
in :mod:`zarr.core.config`.
813813
Use ``None`` to omit default compressors.
814814
815-
For Zarr v2, a "compressor" can be any numcodecs codec. Only a single compressor may
816-
be provided for Zarr v2.
815+
For Zarr format 2, a "compressor" can be any numcodecs codec. Only a single compressor may
816+
be provided for Zarr format 2.
817817
If no ``compressors`` are provided, a default compressor will be used.
818818
These defaults can be changed by modifying the value of ``array.v2_default_compressor``
819819
in :mod:`zarr.core.config`.
820820
Use ``None`` to omit the default compressor.
821821
serializer : dict[str, JSON] | ArrayBytesCodec, optional
822822
Array-to-bytes codec to use for encoding the array data.
823-
Zarr v3 only. Zarr v2 arrays use implicit array-to-bytes conversion.
823+
Zarr format 3 only. Zarr format 2 arrays use implicit array-to-bytes conversion.
824824
If no ``serializer`` is provided, the `zarr.codecs.BytesCodec` codec will be used.
825825
fill_value : Any, optional
826826
Fill value for the array.
827827
order : {"C", "F"}, optional
828828
The memory of the array (default is "C").
829-
For Zarr v2, this parameter sets the memory order of the array.
830-
For Zarr v3, this parameter is deprecated, because memory order
831-
is a runtime parameter for Zarr v3 arrays. The recommended way to specify the memory
832-
order for Zarr v3 arrays is via the ``config`` parameter, e.g. ``{'config': 'C'}``.
829+
For Zarr format 2, this parameter sets the memory order of the array.
830+
For Zarr format 3, this parameter is deprecated, because memory order
831+
is a runtime parameter for Zarr format 3 arrays. The recommended way to specify the memory
832+
order for Zarr format 3 arrays is via the ``config`` parameter, e.g. ``{'config': 'C'}``.
833833
If no ``order`` is provided, a default order will be used.
834834
This default can be changed by modifying the value of ``array.order`` in :mod:`zarr.core.config`.
835835
zarr_format : {2, 3}, optional
@@ -838,11 +838,11 @@ def create_array(
838838
Attributes for the array.
839839
chunk_key_encoding : ChunkKeyEncoding, optional
840840
A specification of how the chunk keys are represented in storage.
841-
For Zarr v3, the default is ``{"name": "default", "separator": "/"}}``.
842-
For Zarr v2, the default is ``{"name": "v2", "separator": "."}}``.
841+
For Zarr format 3, the default is ``{"name": "default", "separator": "/"}}``.
842+
For Zarr format 2, the default is ``{"name": "v2", "separator": "."}}``.
843843
dimension_names : Iterable[str], optional
844844
The names of the dimensions (default is None).
845-
Zarr v3 only. Zarr v2 arrays should not use this parameter.
845+
Zarr format 3 only. Zarr format 2 arrays should not use this parameter.
846846
storage_options : dict, optional
847847
If using an fsspec URL to create the store, these will be passed to the backend implementation.
848848
Ignored otherwise.

src/zarr/codecs/vlen_utf8.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
class VLenUTF8Codec(ArrayBytesCodec):
2929
def __init__(self) -> None:
3030
warn(
31-
"The codec `vlen-utf8` is currently not part in the Zarr version 3 specification. It "
31+
"The codec `vlen-utf8` is currently not part in the Zarr format 3 specification. It "
3232
"may not be supported by other zarr implementations and may change in the future.",
3333
category=UserWarning,
3434
stacklevel=2,
@@ -83,7 +83,7 @@ def compute_encoded_size(self, input_byte_length: int, _chunk_spec: ArraySpec) -
8383
class VLenBytesCodec(ArrayBytesCodec):
8484
def __init__(self) -> None:
8585
warn(
86-
"The codec `vlen-bytes` is currently not part in the Zarr version 3 specification. It "
86+
"The codec `vlen-bytes` is currently not part in the Zarr format 3 specification. It "
8787
"may not be supported by other zarr implementations and may change in the future.",
8888
category=UserWarning,
8989
stacklevel=2,

0 commit comments

Comments
 (0)