Skip to content

Commit c55ffa4

Browse files
committed
Fix test
1 parent a70154e commit c55ffa4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/zarr/core/buffer/core.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,12 @@ def __repr__(self) -> str:
457457
return f"<NDBuffer shape={self.shape} dtype={self.dtype} {self._data!r}>"
458458

459459
def all_equal(self, other: Any) -> bool:
460-
return np.array_equal(self._data, other, equal_nan=True)
460+
# other is expected to be a scalar
461+
# use array_equal to obtain equal_nan=True functionality
462+
result = np.array_equal(
463+
self._data, np.broadcast_to(other, self._data.shape), equal_nan=True
464+
)
465+
return result
461466

462467
def fill(self, value: Any) -> None:
463468
self._data.fill(value)

0 commit comments

Comments
 (0)