Skip to content

Commit b2d5648

Browse files
committed
Pass chunks as a parameter to save_array
Some Numpy arrays-like does not have chunks attribute. We should be able to save chunks of the array somehow. One suggestion is passing the argument to the function. Signed-off-by: Julio Faracco <[email protected]>
1 parent feeb08f commit b2d5648

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/zarr/api/asynchronous.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,9 @@ async def save_array(
420420
if np.isscalar(arr):
421421
arr = np.array(arr)
422422
shape = arr.shape
423-
chunks = getattr(arr, "chunks", None) # for array-likes with chunks attribute
423+
chunks = kwargs.pop(
424+
"chunks", getattr(arr, "chunks", None)
425+
) # for array-likes with chunks attribute
424426
overwrite = kwargs.pop("overwrite", None) or _infer_overwrite(mode)
425427
new = await AsyncArray._create(
426428
store_path,

0 commit comments

Comments
 (0)