@@ -74,7 +74,7 @@ def test_sharded_morton_indexing(
7474 The Morton order cache is cleared before each iteration to measure the
7575 full computation cost.
7676 """
77- from zarr .core .indexing import _morton_order
77+ from zarr .core .indexing import _morton_order , _morton_order_keys
7878
7979 # Create array where each shard contains many small chunks
8080 # e.g., shards=(32,32,32) with chunks=(2,2,2) means 16x16x16 = 4096 chunks per shard
@@ -98,6 +98,7 @@ def test_sharded_morton_indexing(
9898
9999 def read_with_cache_clear () -> None :
100100 _morton_order .cache_clear ()
101+ _morton_order_keys .cache_clear ()
101102 getitem (data , indexer )
102103
103104 benchmark (read_with_cache_clear )
@@ -122,7 +123,7 @@ def test_sharded_morton_indexing_large(
122123 the Morton order computation a more significant portion of total time.
123124 The Morton order cache is cleared before each iteration.
124125 """
125- from zarr .core .indexing import _morton_order
126+ from zarr .core .indexing import _morton_order , _morton_order_keys
126127
127128 # 1x1x1 chunks means chunks_per_shard equals shard shape
128129 shape = tuple (s * 2 for s in shards ) # 2 shards per dimension
@@ -145,6 +146,7 @@ def test_sharded_morton_indexing_large(
145146
146147 def read_with_cache_clear () -> None :
147148 _morton_order .cache_clear ()
149+ _morton_order_keys .cache_clear ()
148150 getitem (data , indexer )
149151
150152 benchmark (read_with_cache_clear )
@@ -164,7 +166,7 @@ def test_sharded_morton_single_chunk(
164166 computing the full Morton order, making the optimization impact clear.
165167 The Morton order cache is cleared before each iteration.
166168 """
167- from zarr .core .indexing import _morton_order
169+ from zarr .core .indexing import _morton_order , _morton_order_keys
168170
169171 # 1x1x1 chunks means chunks_per_shard equals shard shape
170172 shape = tuple (s * 2 for s in shards ) # 2 shards per dimension
@@ -187,6 +189,7 @@ def test_sharded_morton_single_chunk(
187189
188190 def read_with_cache_clear () -> None :
189191 _morton_order .cache_clear ()
192+ _morton_order_keys .cache_clear ()
190193 getitem (data , indexer )
191194
192195 benchmark (read_with_cache_clear )
@@ -211,10 +214,11 @@ def test_morton_order_iter(
211214 optimization impact without array read/write overhead.
212215 The cache is cleared before each iteration.
213216 """
214- from zarr .core .indexing import _morton_order , morton_order_iter
217+ from zarr .core .indexing import _morton_order , _morton_order_keys , morton_order_iter
215218
216219 def compute_morton_order () -> None :
217220 _morton_order .cache_clear ()
221+ _morton_order_keys .cache_clear ()
218222 # Consume the iterator to force computation
219223 list (morton_order_iter (shape ))
220224
@@ -239,7 +243,7 @@ def test_sharded_morton_write_single_chunk(
239243 """
240244 import numpy as np
241245
242- from zarr .core .indexing import _morton_order
246+ from zarr .core .indexing import _morton_order , _morton_order_keys
243247
244248 # 1x1x1 chunks means chunks_per_shard equals shard shape
245249 shape = tuple (s * 2 for s in shards ) # 2 shards per dimension
@@ -262,6 +266,7 @@ def test_sharded_morton_write_single_chunk(
262266
263267 def write_with_cache_clear () -> None :
264268 _morton_order .cache_clear ()
269+ _morton_order_keys .cache_clear ()
265270 data [indexer ] = write_data
266271
267272 benchmark (write_with_cache_clear )
0 commit comments