Skip to content

Commit

Permalink
DataArray.equals also check the dtype.
Browse files Browse the repository at this point in the history
  • Loading branch information
atrabattoni committed Jan 8, 2025
1 parent d1ef449 commit bca92b5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions xdas/core/dataarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ def loc(self):

def equals(self, other):
if isinstance(other, self.__class__):
if not self.dtype == other.dtype:
return False
if not np.array_equal(self.values, other.values, equal_nan=True):
return False
if not self.coords.equals(other.coords):
Expand Down

0 comments on commit bca92b5

Please sign in to comment.