Skip to content

Commit c62aff5

Browse files
brokkoli71dstansby
andauthored
Apply suggestions from code review
Co-authored-by: David Stansby <[email protected]>
1 parent eed4427 commit c62aff5

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/zarr/api/asynchronous.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ async def save_array(
403403
arr : ndarray
404404
NumPy array with data to save.
405405
zarr_format : {2, 3, None}, optional
406-
The zarr format to use when saving (default is 3).
406+
The zarr format to use when saving (default is 3 if not specified).
407407
path : str or None, optional
408408
The path within the store where the array will be saved.
409409
storage_options : dict
@@ -821,7 +821,7 @@ async def create(
821821
chunks : int or tuple of ints, optional
822822
The shape of the array's chunks.
823823
V2 only. V3 arrays should use `chunk_shape` instead.
824-
Default values are guessed based on the shape and dtype.
824+
If not specified, default values are guessed based on the shape and dtype.
825825
dtype : str or dtype, optional
826826
NumPy dtype.
827827
chunk_shape : int or tuple of ints, optional
@@ -830,9 +830,9 @@ async def create(
830830
chunk_key_encoding : ChunkKeyEncoding, optional
831831
A specification of how the chunk keys are represented in storage.
832832
V3 only. V2 arrays should use `dimension_separator` instead.
833-
Default is ("default", "/").
833+
Default is ``("default", "/")``.
834834
codecs : Sequence of Codecs or dicts, optional
835-
An iterable of Codec or dict serializations thereof. The elements of
835+
An iterable of Codec or dict serializations of Codecs. The elements of
836836
this collection specify the transformation from array values to stored bytes.
837837
V3 only. V2 arrays should use `filters` and `compressor` instead.
838838
If no codecs are provided, default codecs will be used:
@@ -842,8 +842,8 @@ async def create(
842842
These defaults can be changed using the `array.v3_default_codecs` variable in the Zarr config.
843843
compressor : Codec, optional
844844
Primary compressor to compress chunk data.
845-
V2 only. V3 arrays should use `codecs` instead.
846-
If neither `compressor` nor `filters` are provided, a default compressor will be used:
845+
V2 only. V3 arrays should use ``codecs`` instead.
846+
If neither ``compressor`` nor ``filters`` are provided, a default compressor will be used:
847847
- For numeric arrays, the default is `ZstdCodec`.
848848
- For Unicode strings, the default is `VLenUTF8Codec`.
849849
- For bytes or objects, the default is `VLenBytesCodec`.
@@ -852,7 +852,7 @@ async def create(
852852
Default value to use for uninitialized portions of the array.
853853
order : {'C', 'F'}, optional
854854
Memory layout to be used within each chunk.
855-
Default is specified in the Zarr config `array.order`.
855+
If not specified, default is taken from the Zarr config ``array.order``.
856856
store : Store or str
857857
Store or path to directory in file system or name of zip file.
858858
synchronizer : object, optional
@@ -867,8 +867,8 @@ async def create(
867867
for storage of both chunks and metadata.
868868
filters : sequence of Codecs, optional
869869
Sequence of filters to use to encode chunk data prior to compression.
870-
V2 only. If neither `compressor` nor `filters` are provided, a default
871-
compressor will be used. (see `compressor` for details)
870+
V2 only. If neither ``compressor`` nor ``filters`` are provided, a default
871+
compressor will be used. (see ``compressor`` for details).
872872
cache_metadata : bool, optional
873873
If True, array configuration metadata will be cached for the
874874
lifetime of the object. If False, array metadata will be reloaded
@@ -884,7 +884,7 @@ async def create(
884884
A codec to encode object arrays, only needed if dtype=object.
885885
dimension_separator : {'.', '/'}, optional
886886
Separator placed between the dimensions of a chunk.
887-
V2 only. V3 arrays should use `chunk_key_encoding` instead.
887+
V2 only. V3 arrays should use ``chunk_key_encoding`` instead.
888888
Default is ".".
889889
.. versionadded:: 2.8
890890

src/zarr/core/array.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ async def _create_v2(
642642
if dimension_separator is None:
643643
dimension_separator = "."
644644

645-
dtype = parse_dtype(dtype, 2)
645+
dtype = parse_dtype(dtype, zarr_format=2)
646646
if not filters and not compressor:
647647
filters, compressor = _default_filters_and_compressor(dtype)
648648
if np.issubdtype(dtype, np.str_):

src/zarr/storage/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def __setattr__(self, attr: str, value: Any) -> None:
3030
warnings.warn(
3131
"setting zarr.storage.default_compressor is deprecated, use "
3232
"zarr.config to configure array.v2_default_compressor "
33-
"e.g. config.set({'codecs.zstd':'your.module.Zstd', 'array.v2_default_compressor.numeric': 'zstd'})",
33+
"e.g. config.set({'codecs.zstd':'numcodecs.Zstd', 'array.v2_default_compressor.numeric': 'zstd'})",
3434
DeprecationWarning,
3535
stacklevel=1,
3636
)

0 commit comments

Comments
 (0)