Skip to content

Commit 470b60f

Browse files
committed
use typerror instead of valuerror; docstring
1 parent 74d31ef commit 470b60f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/zarr/core/group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@ async def create_array(
10281028
Shape of the array.
10291029
dtype : npt.DTypeLike
10301030
Data type of the array.
1031-
chunks : ChunkCoords | Literal["auto"], default is "auto".
1031+
chunks : ChunkCoords | Literal["auto"], default is "auto"
10321032
Chunk shape of the array.
10331033
shards : ChunkCoords, optional
10341034
Shard shape of the array. The default value of ``None`` results in no sharding at all.

src/zarr/registry.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
from typing import TYPE_CHECKING, Any, Generic, TypeVar
77

88
from zarr.abc.codec import ArrayArrayCodec, ArrayBytesCodec, BytesBytesCodec
9-
from zarr.core.common import JSON
109
from zarr.core.config import BadConfigError, config
1110

1211
if TYPE_CHECKING:
1312
from importlib.metadata import EntryPoint
1413

1514
from zarr.abc.codec import Codec, CodecPipeline
1615
from zarr.core.buffer import Buffer, NDBuffer
16+
from zarr.core.common import JSON
1717

1818
__all__ = [
1919
"Registry",
@@ -171,7 +171,7 @@ def _parse_bytes_bytes_codec(data: dict[str, JSON] | BytesBytesCodec) -> BytesBy
171171
result = _resolve_codec(data)
172172
if not isinstance(result, BytesBytesCodec):
173173
msg = f"Expected a dict representation of a BytesBytesCodec; got a dict representation of a {type(result)} instead."
174-
raise ValueError(msg)
174+
raise TypeError(msg)
175175
else:
176176
result = data
177177
return result
@@ -187,7 +187,7 @@ def _parse_array_bytes_codec(data: dict[str, JSON] | ArrayBytesCodec) -> ArrayBy
187187
result = _resolve_codec(data)
188188
if not isinstance(result, ArrayBytesCodec):
189189
msg = f"Expected a dict representation of a ArrayBytesCodec; got a dict representation of a {type(result)} instead."
190-
raise ValueError(msg)
190+
raise TypeError(msg)
191191
else:
192192
result = data
193193
return result
@@ -203,7 +203,7 @@ def _parse_array_array_codec(data: dict[str, JSON] | ArrayArrayCodec) -> ArrayAr
203203
result = _resolve_codec(data)
204204
if not isinstance(result, ArrayArrayCodec):
205205
msg = f"Expected a dict representation of a ArrayArrayCodec; got a dict representation of a {type(result)} instead."
206-
raise ValueError(msg)
206+
raise TypeError(msg)
207207
else:
208208
result = data
209209
return result

0 commit comments

Comments
 (0)