4040 )
4141 from zarr .core .dtype import ZDTypeLike
4242 from zarr .storage import StoreLike
43+ from zarr .types import AnyArray
4344
4445__all__ = [
4546 "array" ,
@@ -168,7 +169,7 @@ def open(
168169 path : str | None = None ,
169170 storage_options : dict [str , Any ] | None = None ,
170171 ** kwargs : Any , # TODO: type kwargs as valid args to async_api.open
171- ) -> Array | Group :
172+ ) -> AnyArray | Group :
172173 """Open a group or array using file-mode-like semantics.
173174
174175 Parameters
@@ -365,7 +366,7 @@ def tree(grp: Group, expand: bool | None = None, level: int | None = None) -> An
365366
366367
367368# TODO: add type annotations for kwargs
368- def array (data : npt .ArrayLike | Array , ** kwargs : Any ) -> Array :
369+ def array (data : npt .ArrayLike | AnyArray , ** kwargs : Any ) -> AnyArray :
369370 """Create an array filled with `data`.
370371
371372 Parameters
@@ -633,7 +634,7 @@ def create(
633634 storage_options : dict [str , Any ] | None = None ,
634635 config : ArrayConfigLike | None = None ,
635636 ** kwargs : Any ,
636- ) -> Array :
637+ ) -> AnyArray :
637638 """Create an array.
638639
639640 Parameters
@@ -769,7 +770,7 @@ def create_array(
769770 overwrite : bool = False ,
770771 config : ArrayConfigLike | None = None ,
771772 write_data : bool = True ,
772- ) -> Array :
773+ ) -> AnyArray :
773774 """Create an array.
774775
775776 This function wraps :func:`zarr.core.array.create_array`.
@@ -917,7 +918,7 @@ def create_array(
917918def from_array (
918919 store : str | StoreLike ,
919920 * ,
920- data : Array | npt .ArrayLike ,
921+ data : AnyArray | npt .ArrayLike ,
921922 write_data : bool = True ,
922923 name : str | None = None ,
923924 chunks : Literal ["auto" , "keep" ] | ChunkCoords = "keep" ,
@@ -934,7 +935,7 @@ def from_array(
934935 storage_options : dict [str , Any ] | None = None ,
935936 overwrite : bool = False ,
936937 config : ArrayConfigLike | None = None ,
937- ) -> Array :
938+ ) -> AnyArray :
938939 """Create an array from an existing array or array-like.
939940
940941 Parameters
@@ -1128,7 +1129,7 @@ def from_array(
11281129
11291130
11301131# TODO: add type annotations for kwargs
1131- def empty (shape : ChunkCoords , ** kwargs : Any ) -> Array :
1132+ def empty (shape : ChunkCoords , ** kwargs : Any ) -> AnyArray :
11321133 """Create an empty array with the specified shape. The contents will be filled with the
11331134 array's fill value or zeros if no fill value is provided.
11341135
@@ -1155,7 +1156,7 @@ def empty(shape: ChunkCoords, **kwargs: Any) -> Array:
11551156
11561157# TODO: move ArrayLike to common module
11571158# TODO: add type annotations for kwargs
1158- def empty_like (a : ArrayLike , ** kwargs : Any ) -> Array :
1159+ def empty_like (a : ArrayLike , ** kwargs : Any ) -> AnyArray :
11591160 """Create an empty array like another array. The contents will be filled with the
11601161 array's fill value or zeros if no fill value is provided.
11611162
@@ -1181,7 +1182,7 @@ def empty_like(a: ArrayLike, **kwargs: Any) -> Array:
11811182
11821183
11831184# TODO: add type annotations for kwargs and fill_value
1184- def full (shape : ChunkCoords , fill_value : Any , ** kwargs : Any ) -> Array :
1185+ def full (shape : ChunkCoords , fill_value : Any , ** kwargs : Any ) -> AnyArray :
11851186 """Create an array with a default fill value.
11861187
11871188 Parameters
@@ -1203,7 +1204,7 @@ def full(shape: ChunkCoords, fill_value: Any, **kwargs: Any) -> Array:
12031204
12041205# TODO: move ArrayLike to common module
12051206# TODO: add type annotations for kwargs
1206- def full_like (a : ArrayLike , ** kwargs : Any ) -> Array :
1207+ def full_like (a : ArrayLike , ** kwargs : Any ) -> AnyArray :
12071208 """Create a filled array like another array.
12081209
12091210 Parameters
@@ -1222,7 +1223,7 @@ def full_like(a: ArrayLike, **kwargs: Any) -> Array:
12221223
12231224
12241225# TODO: add type annotations for kwargs
1225- def ones (shape : ChunkCoords , ** kwargs : Any ) -> Array :
1226+ def ones (shape : ChunkCoords , ** kwargs : Any ) -> AnyArray :
12261227 """Create an array with a fill value of one.
12271228
12281229 Parameters
@@ -1241,7 +1242,7 @@ def ones(shape: ChunkCoords, **kwargs: Any) -> Array:
12411242
12421243
12431244# TODO: add type annotations for kwargs
1244- def ones_like (a : ArrayLike , ** kwargs : Any ) -> Array :
1245+ def ones_like (a : ArrayLike , ** kwargs : Any ) -> AnyArray :
12451246 """Create an array of ones like another array.
12461247
12471248 Parameters
@@ -1267,7 +1268,7 @@ def open_array(
12671268 path : PathLike = "" ,
12681269 storage_options : dict [str , Any ] | None = None ,
12691270 ** kwargs : Any ,
1270- ) -> Array :
1271+ ) -> AnyArray :
12711272 """Open an array using file-mode-like semantics.
12721273
12731274 Parameters
@@ -1303,7 +1304,7 @@ def open_array(
13031304
13041305
13051306# TODO: add type annotations for kwargs
1306- def open_like (a : ArrayLike , path : str , ** kwargs : Any ) -> Array :
1307+ def open_like (a : ArrayLike , path : str , ** kwargs : Any ) -> AnyArray :
13071308 """Open a persistent array like another array.
13081309
13091310 Parameters
@@ -1324,7 +1325,7 @@ def open_like(a: ArrayLike, path: str, **kwargs: Any) -> Array:
13241325
13251326
13261327# TODO: add type annotations for kwargs
1327- def zeros (shape : ChunkCoords , ** kwargs : Any ) -> Array :
1328+ def zeros (shape : ChunkCoords , ** kwargs : Any ) -> AnyArray :
13281329 """Create an array with a fill value of zero.
13291330
13301331 Parameters
@@ -1343,7 +1344,7 @@ def zeros(shape: ChunkCoords, **kwargs: Any) -> Array:
13431344
13441345
13451346# TODO: add type annotations for kwargs
1346- def zeros_like (a : ArrayLike , ** kwargs : Any ) -> Array :
1347+ def zeros_like (a : ArrayLike , ** kwargs : Any ) -> AnyArray :
13471348 """Create an array of zeros like another array.
13481349
13491350 Parameters
0 commit comments