Skip to content

Commit d090fe6

Browse files
committed
support NDArrayLike
1 parent e3380cf commit d090fe6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/zarr/api/asynchronous.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ async def save_array(
394394
or _default_zarr_version()
395395
)
396396
if not isinstance(arr, NDArrayLike):
397-
raise TypeError("arr argument must be numpy array")
397+
raise TypeError("arr argument must be numpy or other NDArrayLike array")
398398

399399
mode = kwargs.pop("mode", None)
400400
store_path = await make_store_path(store, path=path, mode=mode, storage_options=storage_options)
@@ -450,13 +450,13 @@ async def save_group(
450450
)
451451

452452
for arg in args:
453-
if not isinstance(arg, np.ndarray):
453+
if not isinstance(arg, NDArrayLike):
454454
raise TypeError(
455-
"All arguments must be numpy arrays (except store, path, storage_options, and zarr_format)"
455+
"All arguments must be numpy or other NDArrayLike arrays (except store, path, storage_options, and zarr_format)"
456456
)
457457
for k, v in kwargs.items():
458-
if not isinstance(v, np.ndarray):
459-
raise TypeError(f"Keyword argument '{k}' must be a numpy array")
458+
if not isinstance(v, NDArrayLike):
459+
raise TypeError(f"Keyword argument '{k}' must be a numpy or other NDArrayLike array")
460460

461461
if len(args) == 0 and len(kwargs) == 0:
462462
raise ValueError("at least one array must be provided")

0 commit comments

Comments
 (0)