Skip to content

Commit 0da3a03

Browse files
committed
Remove key from n5 array metadata
1 parent 17f54d5 commit 0da3a03

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

zarr/n5.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,9 @@ def array_metadata_to_n5(array_metadata):
355355
compressor_config = compressor_config_to_n5(compressor_config)
356356
array_metadata['compression'] = compressor_config
357357

358+
if 'dimension_separator' in array_metadata:
359+
del array_metadata['dimension_separator']
360+
358361
return array_metadata
359362

360363

zarr/tests/test_core.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1677,14 +1677,6 @@ def create_array(read_only=False, **kwargs):
16771677

16781678
class TestArrayWithN5Store(TestArrayWithDirectoryStore):
16791679

1680-
DIGESTS = (
1681-
"453feae4fa9c7086da9e77982e313a45180e4954",
1682-
"35e50e63ec4443b6f73094daee51af9a28b8702f",
1683-
"8946a49684c3ca9432c896c6129cb00e5d70ad80",
1684-
"c71ad4699147c54cde28a54d23ea83e4c80b14b6",
1685-
"eb997d6507c5bf9ab994b75b28e24ad2a99fa3d6",
1686-
)
1687-
16881680
@staticmethod
16891681
def create_array(read_only=False, **kwargs):
16901682
path = mkdtemp()
@@ -1935,27 +1927,37 @@ def test_compressors(self):
19351927
assert np.all(a2[:] == 1)
19361928

19371929
def test_hexdigest(self):
1930+
expecting = [
1931+
'c6b83adfad999fbd865057531d749d87cf138f58',
1932+
'a3d6d187536ecc3a9dd6897df55d258e2f52f9c5',
1933+
'ec2e008525ae09616dbc1d2408cbdb42532005c8',
1934+
'b63f031031dcd5248785616edcb2d6fe68203c28',
1935+
'0cfc673215a8292a87f3c505e2402ce75243c601',
1936+
]
1937+
found = []
19381938
# Check basic 1-D array
19391939
z = self.create_array(shape=(1050,), chunks=100, dtype='<i4')
1940-
assert self.DIGESTS[0] == z.hexdigest()
1940+
found.append(z.hexdigest())
19411941

19421942
# Check basic 1-D array with different type
19431943
z = self.create_array(shape=(1050,), chunks=100, dtype='<f4')
1944-
assert self.DIGESTS[1] == z.hexdigest()
1944+
found.append(z.hexdigest())
19451945

19461946
# Check basic 2-D array
19471947
z = self.create_array(shape=(20, 35,), chunks=10, dtype='<i4')
1948-
assert self.DIGESTS[2] == z.hexdigest()
1948+
found.append(z.hexdigest())
19491949

19501950
# Check basic 1-D array with some data
19511951
z = self.create_array(shape=(1050,), chunks=100, dtype='<i4')
19521952
z[200:400] = np.arange(200, 400, dtype='i4')
1953-
assert self.DIGESTS[3] == z.hexdigest()
1953+
found.append(z.hexdigest())
19541954

19551955
# Check basic 1-D array with attributes
19561956
z = self.create_array(shape=(1050,), chunks=100, dtype='<i4')
19571957
z.attrs['foo'] = 'bar'
1958-
assert self.DIGESTS[4] == z.hexdigest()
1958+
found.append(z.hexdigest())
1959+
1960+
assert expecting == found
19591961

19601962

19611963
class TestArrayWithDBMStore(TestArray):

0 commit comments

Comments
 (0)