2424from zarr .core .common import (
2525 JSON ,
2626 AccessModeLiteral ,
27- ChunkCoords ,
2827 DimensionNames ,
2928 MemoryOrder ,
3029 ZarrFormat ,
5352if TYPE_CHECKING :
5453 from collections .abc import Iterable
5554
56- import numcodecs .abc
57-
5855 from zarr .abc .codec import Codec
56+ from zarr .abc .numcodec import Numcodec
5957 from zarr .core .buffer import NDArrayLikeOrScalar
6058 from zarr .core .chunk_key_encodings import ChunkKeyEncoding
6159 from zarr .storage import StoreLike
@@ -108,7 +106,7 @@ def _infer_overwrite(mode: AccessModeLiteral) -> bool:
108106 return mode in _OVERWRITE_MODES
109107
110108
111- def _get_shape_chunks (a : ArrayLike | Any ) -> tuple [ChunkCoords | None , ChunkCoords | None ]:
109+ def _get_shape_chunks (a : ArrayLike | Any ) -> tuple [tuple [ int , ...] | None , tuple [ int , ...] | None ]:
112110 """Helper function to get the shape and chunks from an array-like object"""
113111 shape = None
114112 chunks = None
@@ -360,7 +358,9 @@ async def open(
360358 zarr_format = _metadata_dict ["zarr_format" ]
361359 is_v3_array = zarr_format == 3 and _metadata_dict .get ("node_type" ) == "array"
362360 if is_v3_array or zarr_format == 2 :
363- return AsyncArray (store_path = store_path , metadata = _metadata_dict )
361+ return AsyncArray (
362+ store_path = store_path , metadata = _metadata_dict , config = kwargs .get ("config" )
363+ )
364364 except (AssertionError , FileNotFoundError , NodeTypeValidationError ):
365365 pass
366366 return await open_group (store = store_path , zarr_format = zarr_format , mode = mode , ** kwargs )
@@ -866,9 +866,9 @@ async def open_group(
866866
867867
868868async def create (
869- shape : ChunkCoords | int ,
869+ shape : tuple [ int , ...] | int ,
870870 * , # Note: this is a change from v2
871- chunks : ChunkCoords | int | bool | None = None ,
871+ chunks : tuple [ int , ...] | int | bool | None = None ,
872872 dtype : ZDTypeLike | None = None ,
873873 compressor : CompressorLike = "auto" ,
874874 fill_value : Any | None = DEFAULT_FILL_VALUE ,
@@ -878,7 +878,7 @@ async def create(
878878 overwrite : bool = False ,
879879 path : PathLike | None = None ,
880880 chunk_store : StoreLike | None = None ,
881- filters : Iterable [dict [str , JSON ] | numcodecs . abc . Codec ] | None = None ,
881+ filters : Iterable [dict [str , JSON ] | Numcodec ] | None = None ,
882882 cache_metadata : bool | None = None ,
883883 cache_attrs : bool | None = None ,
884884 read_only : bool | None = None ,
@@ -890,7 +890,7 @@ async def create(
890890 meta_array : Any | None = None , # TODO: need type
891891 attributes : dict [str , JSON ] | None = None ,
892892 # v3 only
893- chunk_shape : ChunkCoords | int | None = None ,
893+ chunk_shape : tuple [ int , ...] | int | None = None ,
894894 chunk_key_encoding : (
895895 ChunkKeyEncoding
896896 | tuple [Literal ["default" ], Literal ["." , "/" ]]
@@ -1075,7 +1075,7 @@ async def create(
10751075
10761076
10771077async def empty (
1078- shape : ChunkCoords , ** kwargs : Any
1078+ shape : tuple [ int , ...] , ** kwargs : Any
10791079) -> AsyncArray [ArrayV2Metadata ] | AsyncArray [ArrayV3Metadata ]:
10801080 """Create an empty array with the specified shape. The contents will be filled with the
10811081 array's fill value or zeros if no fill value is provided.
@@ -1127,7 +1127,7 @@ async def empty_like(
11271127
11281128# TODO: add type annotations for fill_value and kwargs
11291129async def full (
1130- shape : ChunkCoords , fill_value : Any , ** kwargs : Any
1130+ shape : tuple [ int , ...] , fill_value : Any , ** kwargs : Any
11311131) -> AsyncArray [ArrayV2Metadata ] | AsyncArray [ArrayV3Metadata ]:
11321132 """Create an array, with `fill_value` being used as the default value for
11331133 uninitialized portions of the array.
@@ -1174,7 +1174,7 @@ async def full_like(
11741174
11751175
11761176async def ones (
1177- shape : ChunkCoords , ** kwargs : Any
1177+ shape : tuple [ int , ...] , ** kwargs : Any
11781178) -> AsyncArray [ArrayV2Metadata ] | AsyncArray [ArrayV3Metadata ]:
11791179 """Create an array, with one being used as the default value for
11801180 uninitialized portions of the array.
@@ -1297,7 +1297,7 @@ async def open_like(
12971297
12981298
12991299async def zeros (
1300- shape : ChunkCoords , ** kwargs : Any
1300+ shape : tuple [ int , ...] , ** kwargs : Any
13011301) -> AsyncArray [ArrayV2Metadata ] | AsyncArray [ArrayV3Metadata ]:
13021302 """Create an array, with zero being used as the default value for
13031303 uninitialized portions of the array.
0 commit comments