diff --git a/src/zarr/api/synchronous.py b/src/zarr/api/synchronous.py index e832ac932..934e22a38 100644 --- a/src/zarr/api/synchronous.py +++ b/src/zarr/api/synchronous.py @@ -985,7 +985,7 @@ def from_array( - dict[str, JSON]: A dict representation of an ``ArrayBytesCodec``. - ArrayBytesCodec: An instance of ``ArrayBytesCodec``. - "auto": a default serializer will be used. These defaults can be changed by modifying the value of - ``array.v3_default_serializer`` in :mod:`zarr.core.config`. + `array.v3_default_serializer` in :mod:`zarr.core.config`. - "keep": Retain the serializer of the input array if it is a zarr Array. fill_value : Any, optional Fill value for the array. diff --git a/src/zarr/core/array.py b/src/zarr/core/array.py index d74ec4870..a008556f6 100644 --- a/src/zarr/core/array.py +++ b/src/zarr/core/array.py @@ -3834,7 +3834,7 @@ async def from_array( - dict[str, JSON]: A dict representation of an ``ArrayBytesCodec``. - ArrayBytesCodec: An instance of ``ArrayBytesCodec``. - "auto": a default serializer will be used. These defaults can be changed by modifying the value of - ``array.v3_default_serializer`` in :mod:`zarr.core.config`. + `array.v3_default_serializer`` in :mod:`zarr.core.config`. - "keep": Retain the serializer of the input array if it is a zarr Array. fill_value : Any, optional @@ -3998,9 +3998,7 @@ async def _copy_array_region(chunk_coords: ChunkCoords | slice, _data: Array) -> ) else: - async def _copy_arraylike_region( - chunk_coords: ChunkCoords | slice, _data: NDArrayLike - ) -> None: + async def _copy_arraylike_region(chunk_coords: slice, _data: NDArrayLike) -> None: await new_array.setitem(chunk_coords, _data[chunk_coords]) # Stream data from the source array to the new array diff --git a/tests/test_array.py b/tests/test_array.py index 822974ddb..c52e14d4c 100644 --- a/tests/test_array.py +++ b/tests/test_array.py @@ -1276,14 +1276,19 @@ async def test_creation_from_other_zarr_format( src_format: ZarrFormat, new_format: ZarrFormat, ) -> None: - kwargs: dict[str, tuple[Literal["default"], Literal[".", "/"]] | Literal[".", "/"]] = {} - # set dimension_separator to non default if src_format == 2: - kwargs["dimension_separator"] = "/" + src = zarr.create( + (50, 50), chunks=(10, 10), store=store, zarr_format=src_format, dimension_separator="/" + ) else: - kwargs["chunk_key_encoding"] = ("default", ".") + src = zarr.create( + (50, 50), + chunks=(10, 10), + store=store, + zarr_format=src_format, + chunk_key_encoding=("default", "."), + ) - src = zarr.create((50, 50), chunks=(10, 10), store=store, zarr_format=src_format, **kwargs) src[:] = np.arange(50 * 50).reshape((50, 50)) result = zarr.from_array( src,