Skip to content

Commit

Permalink
another attempt at fixing types
Browse files Browse the repository at this point in the history
  • Loading branch information
andersy005 committed Nov 1, 2024
1 parent 014e7cf commit 5e22be6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions xarray/core/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 5e22be6

Please sign in to comment.