File tree Expand file tree Collapse file tree 1 file changed +14
-16
lines changed Expand file tree Collapse file tree 1 file changed +14
-16
lines changed Original file line number Diff line number Diff line change 22
33from typing import TYPE_CHECKING
44
5+ import numpy as np
56import pytest
67
78import zarr
@@ -57,22 +58,19 @@ def test_list_prefix(self, store: MemoryStore) -> None:
5758 async def test_deterministic_size (
5859 self , store : MemoryStore , dtype , zarr_format : ZarrFormat
5960 ) -> None :
60- def padding_size () -> int :
61- a = zarr .empty (
62- store = store ,
63- shape = (3 ,),
64- chunks = (1000 ,),
65- dtype = dtype ,
66- zarr_format = zarr_format ,
67- overwrite = True ,
68- )
69- a [...] = 1
70- key = "0" if zarr_format == 2 else "c/0"
71- return len (store ._store_dict [key ])
72-
73- l1 = padding_size ()
74- l2 = padding_size ()
75- assert l1 == l2
61+ a = zarr .empty (
62+ store = store ,
63+ shape = (3 ,),
64+ chunks = (1000 ,),
65+ dtype = dtype ,
66+ zarr_format = zarr_format ,
67+ overwrite = True ,
68+ )
69+ a [...] = 1
70+ a .resize ((1000 ,))
71+
72+ np .testing .assert_array_equal (a [:3 ], 1 )
73+ np .testing .assert_array_equal (a [3 :], 0 )
7674
7775
7876@gpu_test
You can’t perform that action at this time.
0 commit comments