Skip to content

Commit 48c7448

Browse files
committed
apply suggestions from review
1 parent c62aff5 commit 48c7448

File tree

4 files changed

+57
-57
lines changed

4 files changed

+57
-57
lines changed

src/zarr/api/asynchronous.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ async def create(
834834
codecs : Sequence of Codecs or dicts, optional
835835
An iterable of Codec or dict serializations of Codecs. The elements of
836836
this collection specify the transformation from array values to stored bytes.
837-
V3 only. V2 arrays should use `filters` and `compressor` instead.
837+
V3 only. V2 arrays should use ``filters`` and ``compressor`` instead.
838838
If no codecs are provided, default codecs will be used:
839839
- For numeric arrays, the default is `BytesCodec` and `ZstdCodec`.
840840
- For Unicode strings, the default is `VLenUTF8Codec`.

src/zarr/core/array.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -411,15 +411,15 @@ async def create(
411411
chunk_shape : ChunkCoords, optional
412412
The shape of the array's chunks
413413
V3 only. V2 arrays should use `chunks` instead.
414-
Default values are guessed based on the shape and dtype.
414+
If not specified, default are guessed based on the shape and dtype.
415415
chunk_key_encoding : ChunkKeyEncoding, optional
416416
A specification of how the chunk keys are represented in storage.
417417
V3 only. V2 arrays should use `dimension_separator` instead.
418-
Default is ("default", "/").
418+
Default is ``("default", "/")``.
419419
codecs : Sequence of Codecs or dicts, optional
420-
An iterable of Codec or dict serializations thereof. The elements of
420+
An iterable of Codec or dict serializations of Codecs. The elements of
421421
this collection specify the transformation from array values to stored bytes.
422-
V3 only. V2 arrays should use `filters` and `compressor` instead.
422+
V3 only. V2 arrays should use ``filters`` and ``compressor`` instead.
423423
If no codecs are provided, default codecs will be used:
424424
- For numeric arrays, the default is `BytesCodec` and `ZstdCodec`.
425425
- For Unicode strings, the default is `VLenUTF8Codec`.
@@ -431,21 +431,21 @@ async def create(
431431
chunks : ShapeLike, optional
432432
The shape of the array's chunks.
433433
V2 only. V3 arrays should use `chunk_shape` instead.
434-
Default values are guessed based on the shape and dtype.
434+
If not specified, default are guessed based on the shape and dtype.
435435
dimension_separator : Literal[".", "/"], optional
436436
The dimension separator (default is ".").
437-
V2 only. V3 arrays should use `chunk_key_encoding` instead.
437+
V2 only. V3 arrays should use ``chunk_key_encoding`` instead.
438438
order : Literal["C", "F"], optional
439439
The order of the array (default is specified in the Zarr config `array.order`).
440440
filters : list[dict[str, JSON]], optional
441441
Sequence of filters to use to encode chunk data prior to compression.
442-
V2 only. V3 arrays should use `codecs` instead. If neither `compressor`
443-
nor `filters` are provided, a default compressor will be used. (see
444-
`compressor` for details)
442+
V2 only. V3 arrays should use ``codecs`` instead. If neither ``compressor``
443+
nor ``filters`` are provided, a default compressor will be used. (see
444+
``compressor`` for details)
445445
compressor : dict[str, JSON], optional
446446
The compressor used to compress the data (default is None).
447-
V2 only. V3 arrays should use `codecs` instead.
448-
If neither `compressor` nor `filters` are provided, a default compressor will be used:
447+
V2 only. V3 arrays should use ``codecs`` instead.
448+
If neither ``compressor`` nor ``filters`` are provided, a default compressor will be used:
449449
- For numeric arrays, the default is `ZstdCodec`.
450450
- For Unicode strings, the default is `VLenUTF8Codec`.
451451
- For bytes or objects, the default is `VLenBytesCodec`.
@@ -1503,15 +1503,15 @@ def create(
15031503
chunk_shape : ChunkCoords, optional
15041504
The shape of the Array's chunks.
15051505
V3 only. V2 arrays should use `chunks` instead.
1506-
Default values are guessed based on the shape and dtype.
1506+
If not specified, default are guessed based on the shape and dtype.
15071507
chunk_key_encoding : ChunkKeyEncoding, optional
15081508
A specification of how the chunk keys are represented in storage.
15091509
V3 only. V2 arrays should use `dimension_separator` instead.
1510-
Default is ("default", "/").
1510+
Default is ``("default", "/")``.
15111511
codecs : Sequence of Codecs or dicts, optional
1512-
An iterable of Codec or dict serializations thereof. The elements of
1512+
An iterable of Codec or dict serializations of Codecs. The elements of
15131513
this collection specify the transformation from array values to stored bytes.
1514-
V3 only. V2 arrays should use `filters` and `compressor` instead.
1514+
V3 only. V2 arrays should use ``filters`` and ``compressor`` instead.
15151515
If no codecs are provided, default codecs will be used:
15161516
- For numeric arrays, the default is `BytesCodec` and `ZstdCodec`.
15171517
- For Unicode strings, the default is `VLenUTF8Codec`.
@@ -1523,21 +1523,21 @@ def create(
15231523
chunks : ChunkCoords, optional
15241524
The shape of the array's chunks.
15251525
V2 only. V3 arrays should use `chunk_shape` instead.
1526-
Default values are guessed based on the shape and dtype.
1526+
If not specified, default are guessed based on the shape and dtype.
15271527
dimension_separator : Literal[".", "/"], optional
15281528
The dimension separator (default is ".").
1529-
V2 only. V3 arrays should use `chunk_key_encoding` instead.
1529+
V2 only. V3 arrays should use ``chunk_key_encoding`` instead.
15301530
order : Literal["C", "F"], optional
15311531
The order of the array (default is specified in the Zarr config `array.order`).
15321532
filters : list[dict[str, JSON]], optional
15331533
Sequence of filters to use to encode chunk data prior to compression.
1534-
V2 only. V3 arrays should use `codecs` instead. If neither `compressor`
1535-
nor `filters` are provided, a default compressor will be used. (see
1536-
`compressor` for details)
1534+
V2 only. V3 arrays should use ``codecs`` instead. If neither ``compressor``
1535+
nor ``filters`` are provided, a default compressor will be used. (see
1536+
``compressor`` for details)
15371537
compressor : dict[str, JSON], optional
15381538
Primary compressor to compress chunk data.
1539-
V2 only. V3 arrays should use `codecs` instead.
1540-
If neither `compressor` nor `filters` are provided, a default compressor will be used:
1539+
V2 only. V3 arrays should use ``codecs`` instead.
1540+
If neither ``compressor`` nor ``filters`` are provided, a default compressor will be used:
15411541
- For numeric arrays, the default is `ZstdCodec`.
15421542
- For Unicode strings, the default is `VLenUTF8Codec`.
15431543
- For bytes or objects, the default is `VLenBytesCodec`.

src/zarr/core/group.py

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,15 +1036,15 @@ async def create_array(
10361036
chunk_shape : tuple[int, ...] | None = None
10371037
The shape of the chunks of the array.
10381038
V3 only. V2 arrays should use `chunks` instead.
1039-
Default values are guessed based on the shape and dtype.
1039+
If not specified, default are guessed based on the shape and dtype.
10401040
chunk_key_encoding : ChunkKeyEncoding | tuple[Literal["default"], Literal[".", "/"]] | tuple[Literal["v2"], Literal[".", "/"]] | None = None
10411041
A specification of how the chunk keys are represented in storage.
10421042
V3 only. V2 arrays should use `dimension_separator` instead.
1043-
Default is ("default", "/").
1043+
Default is ``("default", "/")``.
10441044
codecs : Iterable[Codec | dict[str, JSON]] | None = None
1045-
An iterable of Codec or dict serializations thereof. The elements of
1045+
An iterable of Codec or dict serializations of Codecs. The elements of
10461046
this collection specify the transformation from array values to stored bytes.
1047-
V3 only. V2 arrays should use `filters` and `compressor` instead.
1047+
V3 only. V2 arrays should use ``filters`` and ``compressor`` instead.
10481048
If no codecs are provided, default codecs will be used:
10491049
- For numeric arrays, the default is `BytesCodec` and `ZstdCodec`.
10501050
- For Unicode strings, the default is `VLenUTF8Codec`.
@@ -1055,21 +1055,21 @@ async def create_array(
10551055
chunks : ChunkCoords | None = None
10561056
The shape of the chunks of the array.
10571057
V2 only. V3 arrays should use `chunk_shape` instead.
1058-
Default values are guessed based on the shape and dtype.
1058+
If not specified, default are guessed based on the shape and dtype.
10591059
dimension_separator : Literal[".", "/"] | None = None
10601060
The delimiter used for the chunk keys. (default: ".")
1061-
V2 only. V3 arrays should use `chunk_key_encoding` instead.
1061+
V2 only. V3 arrays should use ``chunk_key_encoding`` instead.
10621062
order : Literal["C", "F"] | None = None
10631063
The memory order of the array (default is specified in the Zarr config `array.order`).
10641064
filters : list[dict[str, JSON]] | None = None
10651065
Sequence of filters to use to encode chunk data prior to compression.
1066-
V2 only. V3 arrays should use `codecs` instead. If neither `compressor`
1067-
nor `filters` are provided, a default compressor will be used. (see
1068-
`compressor` for details)
1066+
V2 only. V3 arrays should use ``codecs`` instead. If neither ``compressor``
1067+
nor ``filters`` are provided, a default compressor will be used. (see
1068+
``compressor`` for details)
10691069
compressor : dict[str, JSON] | None = None
10701070
The compressor used to compress the data (default is None).
1071-
V2 only. V3 arrays should use `codecs` instead.
1072-
If neither `compressor` nor `filters` are provided, a default compressor will be used:
1071+
V2 only. V3 arrays should use ``codecs`` instead.
1072+
If neither ``compressor`` nor ``filters`` are provided, a default compressor will be used:
10731073
- For numeric arrays, the default is `ZstdCodec`.
10741074
- For Unicode strings, the default is `VLenUTF8Codec`.
10751075
- For bytes or objects, the default is `VLenBytesCodec`.
@@ -2257,15 +2257,15 @@ def create_array(
22572257
chunk_shape : tuple[int, ...] | None = None
22582258
The shape of the chunks of the array.
22592259
V3 only. V2 arrays should use `chunks` instead.
2260-
Default values are guessed based on the shape and dtype.
2260+
If not specified, default are guessed based on the shape and dtype.
22612261
chunk_key_encoding : ChunkKeyEncoding | tuple[Literal["default"], Literal[".", "/"]] | tuple[Literal["v2"], Literal[".", "/"]] | None = None
22622262
A specification of how the chunk keys are represented in storage.
22632263
V3 only. V2 arrays should use `dimension_separator` instead.
2264-
Default is ("default", "/").
2264+
Default is ``("default", "/")``.
22652265
codecs : Iterable[Codec | dict[str, JSON]] | None = None
2266-
An iterable of Codec or dict serializations thereof. The elements of
2266+
An iterable of Codec or dict serializations of Codecs. The elements of
22672267
this collection specify the transformation from array values to stored bytes.
2268-
V3 only. V2 arrays should use `filters` and `compressor` instead.
2268+
V3 only. V2 arrays should use ``filters`` and ``compressor`` instead.
22692269
If no codecs are provided, default codecs will be used:
22702270
- For numeric arrays, the default is `BytesCodec` and `ZstdCodec`.
22712271
- For Unicode strings, the default is `VLenUTF8Codec`.
@@ -2276,21 +2276,21 @@ def create_array(
22762276
chunks : ChunkCoords | None = None
22772277
The shape of the chunks of the array.
22782278
V2 only. V3 arrays should use `chunk_shape` instead.
2279-
Default values are guessed based on the shape and dtype.
2279+
If not specified, default are guessed based on the shape and dtype.
22802280
dimension_separator : Literal[".", "/"] | None = None
22812281
The delimiter used for the chunk keys. (default: ".")
2282-
V2 only. V3 arrays should use `chunk_key_encoding` instead.
2282+
V2 only. V3 arrays should use ``chunk_key_encoding`` instead.
22832283
order : Literal["C", "F"] | None = None
22842284
The memory order of the array (default is specified in the Zarr config `array.order`).
22852285
filters : list[dict[str, JSON]] | None = None
22862286
Sequence of filters to use to encode chunk data prior to compression.
2287-
V2 only. V3 arrays should use `codecs` instead. If neither `compressor`
2288-
nor `filters` are provided, a default compressor will be used. (see
2289-
`compressor` for details)
2287+
V2 only. V3 arrays should use ``codecs`` instead. If neither ``compressor``
2288+
nor ``filters`` are provided, a default compressor will be used. (see
2289+
``compressor`` for details)
22902290
compressor : dict[str, JSON] | None = None
22912291
The compressor used to compress the data (default is None).
2292-
V2 only. V3 arrays should use `codecs` instead.
2293-
If neither `compressor` nor `filters` are provided, a default compressor will be used:
2292+
V2 only. V3 arrays should use ``codecs`` instead.
2293+
If neither ``compressor`` nor ``filters`` are provided, a default compressor will be used:
22942294
- For numeric arrays, the default is `ZstdCodec`.
22952295
- For Unicode strings, the default is `VLenUTF8Codec`.
22962296
- For bytes or objects, the default is `VLenBytesCodec`.
@@ -2621,15 +2621,15 @@ def array(
26212621
chunk_shape : tuple[int, ...] | None = None
26222622
The shape of the chunks of the array.
26232623
V3 only. V2 arrays should use `chunks` instead.
2624-
Default values are guessed based on the shape and dtype.
2624+
If not specified, default are guessed based on the shape and dtype.
26252625
chunk_key_encoding : ChunkKeyEncoding | tuple[Literal["default"], Literal[".", "/"]] | tuple[Literal["v2"], Literal[".", "/"]] | None = None
26262626
A specification of how the chunk keys are represented in storage.
26272627
V3 only. V2 arrays should use `dimension_separator` instead.
2628-
Default is ("default", "/").
2628+
Default is ``("default", "/")``.
26292629
codecs : Iterable[Codec | dict[str, JSON]] | None = None
2630-
An iterable of Codec or dict serializations thereof. The elements of
2630+
An iterable of Codec or dict serializations of Codecs. The elements of
26312631
this collection specify the transformation from array values to stored bytes.
2632-
V3 only. V2 arrays should use `filters` and `compressor` instead.
2632+
V3 only. V2 arrays should use ``filters`` and ``compressor`` instead.
26332633
If no codecs are provided, default codecs will be used:
26342634
- For numeric arrays, the default is `BytesCodec` and `ZstdCodec`.
26352635
- For Unicode strings, the default is `VLenUTF8Codec`.
@@ -2640,21 +2640,21 @@ def array(
26402640
chunks : ChunkCoords | None = None
26412641
The shape of the chunks of the array.
26422642
V2 only. V3 arrays should use `chunk_shape` instead.
2643-
Default values are guessed based on the shape and dtype.
2643+
If not specified, default are guessed based on the shape and dtype.
26442644
dimension_separator : Literal[".", "/"] | None = None
26452645
The delimiter used for the chunk keys. (default: ".")
2646-
V2 only. V3 arrays should use `chunk_key_encoding` instead.
2646+
V2 only. V3 arrays should use ``chunk_key_encoding`` instead.
26472647
order : Literal["C", "F"] | None = None
26482648
The memory order of the array (default is specified in the Zarr config `array.order`).
26492649
filters : list[dict[str, JSON]] | None = None
26502650
Sequence of filters to use to encode chunk data prior to compression.
2651-
V2 only. V3 arrays should use `codecs` instead. If neither `compressor`
2652-
nor `filters` are provided, a default compressor will be used. (see
2653-
`compressor` for details)
2651+
V2 only. V3 arrays should use ``codecs`` instead. If neither ``compressor``
2652+
nor ``filters`` are provided, a default compressor will be used. (see
2653+
``compressor`` for details)
26542654
compressor : dict[str, JSON] | None = None
26552655
The compressor used to compress the data (default is None).
2656-
V2 only. V3 arrays should use `codecs` instead.
2657-
If neither `compressor` nor `filters` are provided, a default compressor will be used:
2656+
V2 only. V3 arrays should use ``codecs`` instead.
2657+
If neither ``compressor`` nor ``filters`` are provided, a default compressor will be used:
26582658
- For numeric arrays, the default is `ZstdCodec`.
26592659
- For Unicode strings, the default is `VLenUTF8Codec`.
26602660
- For bytes or objects, the default is `VLenBytesCodec`.

tests/test_v2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def test_v2_non_contiguous(array_order: Literal["C", "F"], data_order: Literal["
203203

204204

205205
def test_default_compressor_deprecation_warning():
206-
with pytest.warns(DeprecationWarning):
206+
with pytest.warns(DeprecationWarning, match="default_compressor is deprecated"):
207207
zarr.storage.default_compressor = "zarr.codecs.zstd.ZstdCodec()"
208208

209209

0 commit comments

Comments
 (0)