From 5e22be6e5baf77f0c77fc7203a046ef4ac3b1616 Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Thu, 31 Oct 2024 19:05:00 -0700 Subject: [PATCH] another attempt at fixing types --- xarray/core/indexing.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xarray/core/indexing.py b/xarray/core/indexing.py index 1447f00df05..8fe172f6d25 100644 --- a/xarray/core/indexing.py +++ b/xarray/core/indexing.py @@ -577,7 +577,7 @@ def __array__( self, dtype: np.typing.DTypeLike = None, /, *, copy: bool | None = None ) -> np.ndarray: if Version(np.__version__) >= Version("2.0.0"): - return np.asarray(self.get_duck_array(), dtype=dtype, copy=copy) # type: ignore[call-overload] + return np.asarray(self.get_duck_array(), dtype=dtype, copy=copy) else: return np.asarray(self.get_duck_array(), dtype=dtype) @@ -1652,7 +1652,8 @@ def _oindex_get(self, indexer: OuterIndexer): # manual orthogonal indexing (implemented like DaskIndexingAdapter) value = self.array - for axis, subkey in reversed(list(enumerate(indexer))): + subkey: Any + for axis, subkey in reversed(list(enumerate(indexer))): # type: ignore value = value[(slice(None),) * axis + (subkey, Ellipsis)] return value @@ -1693,7 +1694,8 @@ def _oindex_get(self, indexer: OuterIndexer): except NotImplementedError: # manual orthogonal indexing value = self.array - for axis, subkey in reversed(list(enumerate(indexer))): + subkey: Any + for axis, subkey in reversed(list(enumerate(indexer))): # type: ignore value = value[(slice(None),) * axis + (subkey,)] return value