Skip to content

Commit 366da5a

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 366da5a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/zarr/api/asynchronous.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ 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('chunks', getattr(arr, "chunks", None)) # for array-likes with chunks attribute
424424
overwrite = kwargs.pop("overwrite", None) or _infer_overwrite(mode)
425425
new = await AsyncArray._create(
426426
store_path,

0 commit comments

Comments
 (0)