MCPcopy Index your code
hub / github.com/pydata/xarray / equals

Method equals

xarray/core/variable.py:2930–2940  ·  view source on GitHub ↗
(self, other, equiv=None)

Source from the content-addressed store, hash-verified

2928 return self._replace(data=ndata, attrs=attrs, encoding=encoding)
2929
2930 def equals(self, other, equiv=None):
2931 # if equiv is specified, super up
2932 if equiv is not None:
2933 return super().equals(other, equiv)
2934
2935 # otherwise use the native index equals, rather than looking at _data
2936 other = getattr(other, "variable", other)
2937 try:
2938 return self.dims == other.dims and self._data_equals(other)
2939 except (TypeError, AttributeError):
2940 return False
2941
2942 def _data_equals(self, other):
2943 return self._to_index().equals(other._to_index())

Callers

nothing calls this directly

Calls 2

_data_equalsMethod · 0.95
equalsMethod · 0.45

Tested by

no test coverage detected