Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions xarray/core/indexes.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def to_pandas_index(self) -> pd.Index:

def isel(
self, indexers: Mapping[Any, int | slice | np.ndarray | Variable]
) -> Self | None:
) -> Index | None:
"""Maybe returns a new index from the current index itself indexed by
positional indexers.

Expand Down Expand Up @@ -304,7 +304,7 @@ def reindex_like(self, other: Self) -> dict[Hashable, Any]:
"""
raise NotImplementedError(f"{self!r} doesn't support re-indexing labels")

def equals(self, other: Self) -> bool:
def equals(self, other: Index) -> bool:
"""Compare this index with another index of the same type.

Implementation is optional but required in order to support alignment.
Expand Down Expand Up @@ -1424,7 +1424,7 @@ def create_variables(

def isel(
self, indexers: Mapping[Any, int | slice | np.ndarray | Variable]
) -> Self | None:
) -> Index | None:
# TODO: support returning a new index (e.g., possible to re-calculate the
# the transform or calculate another transform on a reduced dimension space)
return None
Expand Down Expand Up @@ -1486,7 +1486,9 @@ def sel(

return IndexSelResult(results)

def equals(self, other: Self) -> bool:
def equals(self, other: Index) -> bool:
if not isinstance(other, CoordinateTransformIndex):
return False
return self.transform.equals(other.transform)

def rename(
Expand Down
Loading