Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Use array_equal instead
  • Loading branch information
dcherian committed Sep 8, 2024
commit a70154eb373bebff0dc8b8ceb9d2a1439bfbca41
7 changes: 1 addition & 6 deletions src/zarr/core/buffer/core.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

import sys
import warnings
from abc import ABC, abstractmethod
from typing import (
TYPE_CHECKING,
Expand Down Expand Up @@ -458,11 +457,7 @@ def __repr__(self) -> str:
return f"<NDBuffer shape={self.shape} dtype={self.dtype} {self._data!r}>"

def all_equal(self, other: Any) -> bool:
with warnings.catch_warnings():
warnings.filterwarnings(
"ignore", r"invalid value encountered in equal", category=RuntimeWarning
)
return bool((self._data == other).all())
return np.array_equal(self._data, other, equal_nan=True)

def fill(self, value: Any) -> None:
self._data.fill(value)
Expand Down