Skip to content

Commit 8d27ac2

Browse files
committed
clean up some type hints and docstrings
1 parent 5edb999 commit 8d27ac2

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/zarr/core/array.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
from zarr.core.chunk_key_encodings import (
4343
ChunkKeyEncoding,
4444
ChunkKeyEncodingLike,
45-
ChunkKeyEncodingParams,
4645
DefaultChunkKeyEncoding,
4746
V2ChunkKeyEncoding,
4847
)
@@ -413,7 +412,7 @@ async def create(
413412
# v3 only
414413
chunk_shape: ShapeLike | None = None,
415414
chunk_key_encoding: (
416-
ChunkKeyEncoding
415+
ChunkKeyEncodingLike
417416
| tuple[Literal["default"], Literal[".", "/"]]
418417
| tuple[Literal["v2"], Literal[".", "/"]]
419418
| None
@@ -454,7 +453,7 @@ async def create(
454453
The shape of the array's chunks
455454
Zarr format 3 only. Zarr format 2 arrays should use `chunks` instead.
456455
If not specified, default are guessed based on the shape and dtype.
457-
chunk_key_encoding : ChunkKeyEncoding, optional
456+
chunk_key_encoding : ChunkKeyEncodingLike, optional
458457
A specification of how the chunk keys are represented in storage.
459458
Zarr format 3 only. Zarr format 2 arrays should use `dimension_separator` instead.
460459
Default is ``("default", "/")``.
@@ -1761,7 +1760,7 @@ def create(
17611760
The shape of the Array's chunks.
17621761
Zarr format 3 only. Zarr format 2 arrays should use `chunks` instead.
17631762
If not specified, default are guessed based on the shape and dtype.
1764-
chunk_key_encoding : ChunkKeyEncoding, optional
1763+
chunk_key_encoding : ChunkKeyEncodingLike, optional
17651764
A specification of how the chunk keys are represented in storage.
17661765
Zarr format 3 only. Zarr format 2 arrays should use `dimension_separator` instead.
17671766
Default is ``("default", "/")``.
@@ -3881,7 +3880,7 @@ async def init_array(
38813880
The zarr format to use when saving.
38823881
attributes : dict, optional
38833882
Attributes for the array.
3884-
chunk_key_encoding : ChunkKeyEncoding, optional
3883+
chunk_key_encoding : ChunkKeyEncodingLike, optional
38853884
A specification of how the chunk keys are represented in storage.
38863885
For Zarr format 3, the default is ``{"name": "default", "separator": "/"}}``.
38873886
For Zarr format 2, the default is ``{"name": "v2", "separator": "."}}``.
@@ -4020,7 +4019,7 @@ async def create_array(
40204019
order: MemoryOrder | None = None,
40214020
zarr_format: ZarrFormat | None = 3,
40224021
attributes: dict[str, JSON] | None = None,
4023-
chunk_key_encoding: ChunkKeyEncoding | ChunkKeyEncodingParams | None = None,
4022+
chunk_key_encoding: ChunkKeyEncodingLike | None = None,
40244023
dimension_names: Iterable[str] | None = None,
40254024
storage_options: dict[str, Any] | None = None,
40264025
overwrite: bool = False,
@@ -4102,7 +4101,7 @@ async def create_array(
41024101
The zarr format to use when saving.
41034102
attributes : dict, optional
41044103
Attributes for the array.
4105-
chunk_key_encoding : ChunkKeyEncoding, optional
4104+
chunk_key_encoding : ChunkKeyEncodingLike, optional
41064105
A specification of how the chunk keys are represented in storage.
41074106
For Zarr format 3, the default is ``{"name": "default", "separator": "/"}}``.
41084107
For Zarr format 2, the default is ``{"name": "v2", "separator": "."}}``.
@@ -4175,7 +4174,7 @@ async def create_array(
41754174

41764175

41774176
def _parse_chunk_key_encoding(
4178-
data: ChunkKeyEncoding | ChunkKeyEncodingParams | None, zarr_format: ZarrFormat
4177+
data: ChunkKeyEncodingLike | None, zarr_format: ZarrFormat
41794178
) -> ChunkKeyEncoding:
41804179
"""
41814180
Take an implicit specification of a chunk key encoding and parse it into a ChunkKeyEncoding object.
@@ -4370,7 +4369,7 @@ def _parse_data_params(
43704369
if data is None:
43714370
if shape is None:
43724371
msg = (
4373-
"The data parameter was set to None, but shape was not specified."
4372+
"The data parameter was set to None, but shape was not specified. "
43744373
"Either provide a value for data, or specify shape."
43754374
)
43764375
raise ValueError(msg)

0 commit comments

Comments
 (0)