Skip to content

Commit

Permalink
Pass chunks as a parameter to save_array
Browse files Browse the repository at this point in the history
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 <jfaracco@redhat.com>
  • Loading branch information
jcfaracco committed Feb 13, 2025
1 parent feeb08f commit 366da5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/zarr/api/asynchronous.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ async def save_array(
if np.isscalar(arr):
arr = np.array(arr)
shape = arr.shape
chunks = getattr(arr, "chunks", None) # for array-likes with chunks attribute
chunks = kwargs.pop('chunks', getattr(arr, "chunks", None)) # for array-likes with chunks attribute
overwrite = kwargs.pop("overwrite", None) or _infer_overwrite(mode)
new = await AsyncArray._create(
store_path,
Expand Down

0 comments on commit 366da5a

Please sign in to comment.