Skip to content

Commit 4f3e156

Browse files
committed
fix mypy and readthedocs
1 parent fc69b67 commit 4f3e156

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

src/zarr/api/synchronous.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@ def from_array(
915915
overwrite: bool = False,
916916
config: ArrayConfig | ArrayConfigLike | None = None,
917917
) -> Array:
918-
"""Create an array from an existing array.
918+
"""Create an array from an existing array or array-like.
919919
920920
Parameters
921921
----------

src/zarr/core/array.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3756,7 +3756,7 @@ async def from_array(
37563756
overwrite: bool = False,
37573757
config: ArrayConfig | ArrayConfigLike | None = None,
37583758
) -> AsyncArray[ArrayV2Metadata] | AsyncArray[ArrayV3Metadata]:
3759-
"""Create an array from an existing array.
3759+
"""Create an array from an existing array or array-like.
37603760
37613761
Parameters
37623762
----------
@@ -3774,9 +3774,11 @@ async def from_array(
37743774
chunks : ChunkCoords or "auto" or "keep", optional
37753775
Chunk shape of the array.
37763776
Following values are supported:
3777-
- "auto": Automatically determine the chunk shape based on the array's shape and dtype.
3778-
- "keep": Retain the chunk shape of the data array if it is a zarr Array.
3779-
- ChunkCoords: A tuple of integers representing the chunk shape.
3777+
3778+
- "auto": Automatically determine the chunk shape based on the array's shape and dtype.
3779+
- "keep": Retain the chunk shape of the data array if it is a zarr Array.
3780+
- ChunkCoords: A tuple of integers representing the chunk shape.
3781+
37803782
If not specified, defaults to "keep" if data is a zarr Array, otherwise "auto".
37813783
shards : ChunkCoords, optional
37823784
Shard shape of the array. The default value of ``None`` results in no sharding at all.
@@ -3792,9 +3794,11 @@ async def from_array(
37923794
the order if your filters is consistent with the behavior of each filter.
37933795
37943796
Following values are supported:
3797+
37953798
- Iterable[Codec]: List of filters to apply to the array.
37963799
- "auto": Automatically determine the filters based on the array's dtype.
37973800
- "keep": Retain the filters of the data array if it is a zarr Array.
3801+
37983802
If no ``filters`` are provided, defaults to "keep" if data is a zarr Array, otherwise "auto".
37993803
compressors : Iterable[Codec] or "auto" or "keep", optional
38003804
List of compressors to apply to the array. Compressors are applied in order, and after any
@@ -3807,20 +3811,24 @@ async def from_array(
38073811
be provided for Zarr format 2.
38083812
38093813
Following values are supported:
3814+
38103815
- Iterable[Codec]: List of compressors to apply to the array.
38113816
- "auto": Automatically determine the compressors based on the array's dtype.
38123817
- "keep": Retain the compressors of the input array if it is a zarr Array.
3818+
38133819
If no ``compressors`` are provided, defaults to "keep" if data is a zarr Array, otherwise "auto".
38143820
serializer : dict[str, JSON] | ArrayBytesCodec or "auto" or "keep", optional
38153821
Array-to-bytes codec to use for encoding the array data.
38163822
Zarr format 3 only. Zarr format 2 arrays use implicit array-to-bytes conversion.
38173823
38183824
Following values are supported:
3825+
38193826
- dict[str, JSON]: A dict representation of an ``ArrayBytesCodec``.
38203827
- ArrayBytesCodec: An instance of ``ArrayBytesCodec``.
38213828
- "auto": a default serializer will be used. These defaults can be changed by modifying the value of
38223829
``array.v3_default_serializer`` in :mod:`zarr.core.config`.
38233830
- "keep": Retain the serializer of the input array if it is a zarr Array.
3831+
38243832
fill_value : Any, optional
38253833
Fill value for the array.
38263834
If not specified, defaults to the fill value of the data array.
@@ -3983,7 +3991,7 @@ async def _copy_array_region(chunk_coords: ChunkCoords | slice, _data: Array) ->
39833991
else:
39843992

39853993
async def _copy_arraylike_region(
3986-
chunk_coords: ChunkCoords | slice, _data: npt.ArrayLike
3994+
chunk_coords: ChunkCoords | slice, _data: NDArrayLike
39873995
) -> None:
39883996
await new_array.setitem(chunk_coords, _data[chunk_coords])
39893997

0 commit comments

Comments
 (0)