From 1173cc094f99a1c1a66de585bca714f51c720081 Mon Sep 17 00:00:00 2001 From: Illviljan <14371165+Illviljan@users.noreply.github.com> Date: Sat, 21 Sep 2024 19:59:04 +0200 Subject: [PATCH] Update indexing.py --- xarray/core/indexing.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xarray/core/indexing.py b/xarray/core/indexing.py index d3a6d340d90..67912908a2b 100644 --- a/xarray/core/indexing.py +++ b/xarray/core/indexing.py @@ -507,7 +507,7 @@ class ExplicitlyIndexed: def __array__(self, dtype: np.typing.DTypeLike = None) -> np.ndarray: # Leave casting to an array up to the underlying array type. - return np.asarray(self.get_duck_array(), dtype=dtype, copy=copy) + return np.asarray(self.get_duck_array(), dtype=dtype) def get_duck_array(self): return self.array @@ -1682,7 +1682,7 @@ def __array__(self, dtype: DTypeLike = None) -> np.ndarray: with suppress(AttributeError): # this might not be public API array = array.astype("object") - return np.asarray(array.values, dtype=dtype, copy=copy) + return np.asarray(array.values, dtype=dtype) def get_duck_array(self) -> np.ndarray: return np.asarray(self) @@ -1839,7 +1839,7 @@ def __array__(self, dtype: DTypeLike = None) -> np.ndarray: self.array.get_level_values(self.level).values, dtype=dtype ) else: - return super().__array__(dtype, copy=copy) + return super().__array__(dtype) def _convert_scalar(self, item): if isinstance(item, tuple) and self.level is not None: