Skip to content

Commit

Permalink
Merge branch 'test/serialization' of github.com:jhamman/zarr-python i…
Browse files Browse the repository at this point in the history
…nto test/serialization
  • Loading branch information
jhamman committed Sep 14, 2024
2 parents c80ee2b + 339ce1c commit 43b482f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/zarr/core/buffer/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,10 @@ def __add__(self, other: Buffer) -> Self:
...

def __eq__(self, other: object) -> bool:
# Note: this was needed to support comparing MemoryStore instances with Buffer values in them
# if/when we stopped putting buffers in memory stores, this can be removed
return isinstance(other, type(self)) and self.to_bytes() == other.to_bytes()
# Another Buffer class can override this to choose a more efficient path
return isinstance(other, Buffer) and np.array_equal(
self.as_numpy_array(), other.as_numpy_array()
)


class NDBuffer:
Expand Down
3 changes: 1 addition & 2 deletions tests/v3/test_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
import numpy as np
import pytest

from zarr.core.array import Array, AsyncArray
from zarr import Array, AsyncArray, Group
from zarr.core.common import ZarrFormat
from zarr.core.group import Group
from zarr.errors import ContainsArrayError, ContainsGroupError
from zarr.store import LocalStore, MemoryStore
from zarr.store.common import StorePath
Expand Down

0 comments on commit 43b482f

Please sign in to comment.