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
13 changes: 13 additions & 0 deletions xarray/core/variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -1247,6 +1247,19 @@ def copy(self, deep=True):
return type(self)(self.dims, self._data, self._attrs,
self._encoding, fastpath=True)

def equals(self, other, equiv=None):
# if equiv is specified, super up
if equiv is not None:
return super(IndexVariable, self).equals(other, equiv)

# otherwise use the native index equals, rather than looking at _data
other = getattr(other, 'variable', other)
try:
return (self.dims == other.dims and
self._data_equals(other))
except (TypeError, AttributeError):
return False

def _data_equals(self, other):
return self.to_index().equals(other.to_index())

Expand Down