Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silence hypothesis complex warning #2157

Merged
merged 9 commits into from
Sep 17, 2024
Merged
Changes from 3 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
5 changes: 4 additions & 1 deletion src/zarr/core/buffer/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,10 @@ def __repr__(self) -> str:
return f"<NDBuffer shape={self.shape} dtype={self.dtype} {self._data!r}>"

def all_equal(self, other: Any) -> bool:
return bool((self._data == other).all())
# use array_equal to obtain equal_nan=True functionality
data, other = np.broadcast_arrays(self._data, other)
dcherian marked this conversation as resolved.
Show resolved Hide resolved
result = np.array_equal(self._data, other, equal_nan=True)
return result

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