3333 from zarr .core .common import (
3434 JSON ,
3535 AccessModeLiteral ,
36- ChunkCoords ,
3736 DimensionNames ,
3837 MemoryOrder ,
3938 ShapeLike ,
@@ -598,9 +597,9 @@ def create_group(
598597
599598# TODO: add type annotations for kwargs
600599def create (
601- shape : ChunkCoords | int ,
600+ shape : tuple [ int , ...] | int ,
602601 * , # Note: this is a change from v2
603- chunks : ChunkCoords | int | bool | None = None ,
602+ chunks : tuple [ int , ...] | int | bool | None = None ,
604603 dtype : ZDTypeLike | None = None ,
605604 compressor : CompressorLike = "auto" ,
606605 fill_value : Any | None = DEFAULT_FILL_VALUE , # TODO: need type
@@ -622,7 +621,7 @@ def create(
622621 meta_array : Any | None = None , # TODO: need type
623622 attributes : dict [str , JSON ] | None = None ,
624623 # v3 only
625- chunk_shape : ChunkCoords | int | None = None ,
624+ chunk_shape : tuple [ int , ...] | int | None = None ,
626625 chunk_key_encoding : (
627626 ChunkKeyEncoding
628627 | tuple [Literal ["default" ], Literal ["." , "/" ]]
@@ -755,7 +754,7 @@ def create_array(
755754 shape : ShapeLike | None = None ,
756755 dtype : ZDTypeLike | None = None ,
757756 data : np .ndarray [Any , np .dtype [Any ]] | None = None ,
758- chunks : ChunkCoords | Literal ["auto" ] = "auto" ,
757+ chunks : tuple [ int , ...] | Literal ["auto" ] = "auto" ,
759758 shards : ShardsLike | None = None ,
760759 filters : FiltersLike = "auto" ,
761760 compressors : CompressorsLike = "auto" ,
@@ -782,18 +781,17 @@ def create_array(
782781 name : str or None, optional
783782 The name of the array within the store. If ``name`` is ``None``, the array will be located
784783 at the root of the store.
785- shape : ChunkCoords , optional
786- Shape of the array. Can be ``None`` if ``data`` is provided.
784+ shape : ShapeLike , optional
785+ Shape of the array. Must be ``None`` if ``data`` is provided.
787786 dtype : ZDTypeLike, optional
788- Data type of the array. Can be ``None`` if ``data`` is provided.
787+ Data type of the array. Must be ``None`` if ``data`` is provided.
789788 data : np.ndarray, optional
790789 Array-like data to use for initializing the array. If this parameter is provided, the
791- ``shape`` and ``dtype`` parameters must be identical to ``data.shape`` and ``data.dtype``,
792- or ``None``.
793- chunks : ChunkCoords, optional
790+ ``shape`` and ``dtype`` parameters must be ``None``.
791+ chunks : tuple[int, ...], optional
794792 Chunk shape of the array.
795793 If not specified, default are guessed based on the shape and dtype.
796- shards : ChunkCoords , optional
794+ shards : tuple[int, ...] , optional
797795 Shard shape of the array. The default value of ``None`` results in no sharding at all.
798796 filters : Iterable[Codec], optional
799797 Iterable of filters to apply to each chunk of the array, in order, before serializing that
@@ -921,7 +919,7 @@ def from_array(
921919 data : Array | npt .ArrayLike ,
922920 write_data : bool = True ,
923921 name : str | None = None ,
924- chunks : Literal ["auto" , "keep" ] | ChunkCoords = "keep" ,
922+ chunks : Literal ["auto" , "keep" ] | tuple [ int , ...] = "keep" ,
925923 shards : ShardsLike | None | Literal ["keep" ] = "keep" ,
926924 filters : FiltersLike | Literal ["keep" ] = "keep" ,
927925 compressors : CompressorsLike | Literal ["keep" ] = "keep" ,
@@ -951,22 +949,22 @@ def from_array(
951949 name : str or None, optional
952950 The name of the array within the store. If ``name`` is ``None``, the array will be located
953951 at the root of the store.
954- chunks : ChunkCoords or "auto" or "keep", optional
952+ chunks : tuple[int, ...] or "auto" or "keep", optional
955953 Chunk shape of the array.
956954 Following values are supported:
957955
958956 - "auto": Automatically determine the chunk shape based on the array's shape and dtype.
959957 - "keep": Retain the chunk shape of the data array if it is a zarr Array.
960- - ChunkCoords : A tuple of integers representing the chunk shape.
958+ - tuple[int, ...] : A tuple of integers representing the chunk shape.
961959
962960 If not specified, defaults to "keep" if data is a zarr Array, otherwise "auto".
963- shards : ChunkCoords , optional
961+ shards : tuple[int, ...] , optional
964962 Shard shape of the array.
965963 Following values are supported:
966964
967965 - "auto": Automatically determine the shard shape based on the array's shape and chunk shape.
968966 - "keep": Retain the shard shape of the data array if it is a zarr Array.
969- - ChunkCoords : A tuple of integers representing the shard shape.
967+ - tuple[int, ...] : A tuple of integers representing the shard shape.
970968 - None: No sharding.
971969
972970 If not specified, defaults to "keep" if data is a zarr Array, otherwise None.
@@ -1129,7 +1127,7 @@ def from_array(
11291127
11301128
11311129# TODO: add type annotations for kwargs
1132- def empty (shape : ChunkCoords , ** kwargs : Any ) -> Array :
1130+ def empty (shape : tuple [ int , ...] , ** kwargs : Any ) -> Array :
11331131 """Create an empty array with the specified shape. The contents will be filled with the
11341132 array's fill value or zeros if no fill value is provided.
11351133
@@ -1182,7 +1180,7 @@ def empty_like(a: ArrayLike, **kwargs: Any) -> Array:
11821180
11831181
11841182# TODO: add type annotations for kwargs and fill_value
1185- def full (shape : ChunkCoords , fill_value : Any , ** kwargs : Any ) -> Array :
1183+ def full (shape : tuple [ int , ...] , fill_value : Any , ** kwargs : Any ) -> Array :
11861184 """Create an array with a default fill value.
11871185
11881186 Parameters
@@ -1223,7 +1221,7 @@ def full_like(a: ArrayLike, **kwargs: Any) -> Array:
12231221
12241222
12251223# TODO: add type annotations for kwargs
1226- def ones (shape : ChunkCoords , ** kwargs : Any ) -> Array :
1224+ def ones (shape : tuple [ int , ...] , ** kwargs : Any ) -> Array :
12271225 """Create an array with a fill value of one.
12281226
12291227 Parameters
@@ -1325,7 +1323,7 @@ def open_like(a: ArrayLike, path: str, **kwargs: Any) -> Array:
13251323
13261324
13271325# TODO: add type annotations for kwargs
1328- def zeros (shape : ChunkCoords , ** kwargs : Any ) -> Array :
1326+ def zeros (shape : tuple [ int , ...] , ** kwargs : Any ) -> Array :
13291327 """Create an array with a fill value of zero.
13301328
13311329 Parameters
0 commit comments