Skip to content

Commit a2373ad

Browse files
committed
fix mypy and readthedocs
1 parent addb785 commit a2373ad

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

src/zarr/api/synchronous.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ def from_array(
985985
- dict[str, JSON]: A dict representation of an ``ArrayBytesCodec``.
986986
- ArrayBytesCodec: An instance of ``ArrayBytesCodec``.
987987
- "auto": a default serializer will be used. These defaults can be changed by modifying the value of
988-
``array.v3_default_serializer`` in :mod:`zarr.core.config`.
988+
`array.v3_default_serializer` in :mod:`zarr.core.config`.
989989
- "keep": Retain the serializer of the input array if it is a zarr Array.
990990
fill_value : Any, optional
991991
Fill value for the array.

src/zarr/core/array.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3834,7 +3834,7 @@ async def from_array(
38343834
- dict[str, JSON]: A dict representation of an ``ArrayBytesCodec``.
38353835
- ArrayBytesCodec: An instance of ``ArrayBytesCodec``.
38363836
- "auto": a default serializer will be used. These defaults can be changed by modifying the value of
3837-
``array.v3_default_serializer`` in :mod:`zarr.core.config`.
3837+
`array.v3_default_serializer`` in :mod:`zarr.core.config`.
38383838
- "keep": Retain the serializer of the input array if it is a zarr Array.
38393839
38403840
fill_value : Any, optional
@@ -3998,9 +3998,7 @@ async def _copy_array_region(chunk_coords: ChunkCoords | slice, _data: Array) ->
39983998
)
39993999
else:
40004000

4001-
async def _copy_arraylike_region(
4002-
chunk_coords: ChunkCoords | slice, _data: NDArrayLike
4003-
) -> None:
4001+
async def _copy_arraylike_region(chunk_coords: slice, _data: NDArrayLike) -> None:
40044002
await new_array.setitem(chunk_coords, _data[chunk_coords])
40054003

40064004
# Stream data from the source array to the new array

tests/test_array.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,14 +1276,19 @@ async def test_creation_from_other_zarr_format(
12761276
src_format: ZarrFormat,
12771277
new_format: ZarrFormat,
12781278
) -> None:
1279-
kwargs: dict[str, tuple[Literal["default"], Literal[".", "/"]] | Literal[".", "/"]] = {}
1280-
# set dimension_separator to non default
12811279
if src_format == 2:
1282-
kwargs["dimension_separator"] = "/"
1280+
src = zarr.create(
1281+
(50, 50), chunks=(10, 10), store=store, zarr_format=src_format, dimension_separator="/"
1282+
)
12831283
else:
1284-
kwargs["chunk_key_encoding"] = ("default", ".")
1284+
src = zarr.create(
1285+
(50, 50),
1286+
chunks=(10, 10),
1287+
store=store,
1288+
zarr_format=src_format,
1289+
chunk_key_encoding=("default", "."),
1290+
)
12851291

1286-
src = zarr.create((50, 50), chunks=(10, 10), store=store, zarr_format=src_format, **kwargs)
12871292
src[:] = np.arange(50 * 50).reshape((50, 50))
12881293
result = zarr.from_array(
12891294
src,

0 commit comments

Comments
 (0)