Skip to content

Commit

Permalink
Use get_duck_array instead of get_array
Browse files Browse the repository at this point in the history
Fix `TypeError: Implicit conversion to a NumPy array is not allowed. Please use `.get()` to construct a NumPy array explicitly` on https://github.com/pydata/xarray/blob/v2024.11.0/xarray/core/indexing.py#L578
  • Loading branch information
weiji14 committed Dec 14, 2024
1 parent f3df115 commit 4e1857a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cupy_xarray/kvikio.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class EagerCupyZarrArrayWrapper(ZarrArrayWrapper):
def __array__(self):
return self._array[:].get()

def get_array(self):
def get_duck_array(self):
# total hack: make a numpy array look like a Zarr array
# this gets us through Xarray's backend layers
return DummyZarrArrayWrapper(self._array[:].get())
Expand Down

0 comments on commit 4e1857a

Please sign in to comment.