Skip to content

Commit a70154e

Browse files
committed
Use array_equal instead
1 parent 2117b59 commit a70154e

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/zarr/core/buffer/core.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22

33
import sys
4-
import warnings
54
from abc import ABC, abstractmethod
65
from typing import (
76
TYPE_CHECKING,
@@ -458,11 +457,7 @@ def __repr__(self) -> str:
458457
return f"<NDBuffer shape={self.shape} dtype={self.dtype} {self._data!r}>"
459458

460459
def all_equal(self, other: Any) -> bool:
461-
with warnings.catch_warnings():
462-
warnings.filterwarnings(
463-
"ignore", r"invalid value encountered in equal", category=RuntimeWarning
464-
)
465-
return bool((self._data == other).all())
460+
return np.array_equal(self._data, other, equal_nan=True)
466461

467462
def fill(self, value: Any) -> None:
468463
self._data.fill(value)

0 commit comments

Comments
 (0)