Skip to content

Commit

Permalink
remove the apparently-unused _drop_indexed_coords method
Browse files Browse the repository at this point in the history
  • Loading branch information
TomNicholas committed Sep 10, 2024
1 parent fdae5bc commit 9dc845a
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions xarray/core/coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,14 +772,6 @@ def _drop_coords(self, coord_names):
del self._data._indexes[name]
self._data._coord_names.difference_update(coord_names)

def _drop_indexed_coords(self, coords_to_drop: set[Hashable]) -> None:
assert self._data.xindexes is not None
new_coords = drop_indexed_coords(coords_to_drop, self)
for name in self._data._coord_names - new_coords._names:
del self._data._variables[name]
self._data._indexes = dict(new_coords.xindexes)
self._data._coord_names.intersection_update(new_coords._names)

def __delitem__(self, key: Hashable) -> None:
if key in self:
del self._data[key]
Expand Down Expand Up @@ -889,13 +881,6 @@ def _drop_coords(self, coord_names):
del self._data._node_coord_variables[name]
del self._data._node_indexes[name]

def _drop_indexed_coords(self, coords_to_drop: set[Hashable]) -> None:
assert self._data.xindexes is not None
new_coords = drop_indexed_coords(coords_to_drop, self)
for name in self._data._node_coord_variables - new_coords._names:
del self._data._node_coord_variables[name]
self._data._node_indexes = dict(new_coords.xindexes)

def __delitem__(self, key: Hashable) -> None:
if key in self:
del self._data[key] # type: ignore[arg-type] # see https://github.com/pydata/xarray/issues/8836
Expand Down

0 comments on commit 9dc845a

Please sign in to comment.