1010import zarr .api .asynchronous
1111from zarr import Array , AsyncArray , Group
1212from zarr .codecs import BytesCodec , VLenBytesCodec
13- from zarr .core ._info import ArrayInfo
1413from zarr .core .array import chunks_initialized
1514from zarr .core .buffer import default_buffer_prototype
1615from zarr .core .buffer .cpu import NDBuffer
1716from zarr .core .common import JSON , MemoryOrder , ZarrFormat
1817from zarr .core .group import AsyncGroup
1918from zarr .core .indexing import ceildiv
20- from zarr .core .metadata .v3 import DataType
2119from zarr .core .sync import sync
2220from zarr .errors import ContainsArrayError , ContainsGroupError
2321from zarr .storage import LocalStore , MemoryStore
2422from zarr .storage .common import StorePath
2523
2624
27- @pytest .mark .parametrize ("store" , ["local_a " , "memory_a " , "zip_a " , "remote_a " ], indirect = ["store" ])
25+ @pytest .mark .parametrize ("store" , ["local " , "memory " , "zip " , "remote " ], indirect = ["store" ])
2826@pytest .mark .parametrize ("zarr_format" , [2 , 3 ])
2927@pytest .mark .parametrize ("exists_ok" , [True , False ])
3028@pytest .mark .parametrize ("extant_node" , ["array" , "group" ])
@@ -75,7 +73,7 @@ def test_array_creation_existing_node(
7573 )
7674
7775
78- @pytest .mark .parametrize ("store" , ["local_a " , "memory_a " , "zip_a " , "remote_a " ], indirect = ["store" ])
76+ @pytest .mark .parametrize ("store" , ["local " , "memory " , "zip " , "remote " ], indirect = ["store" ])
7977@pytest .mark .parametrize ("zarr_format" , [2 , 3 ])
8078async def test_create_creates_parents (
8179 store : LocalStore | MemoryStore , zarr_format : ZarrFormat
@@ -115,7 +113,7 @@ async def test_create_creates_parents(
115113 assert isinstance (g , AsyncGroup )
116114
117115
118- @pytest .mark .parametrize ("store" , ["local_a " , "memory_a " , "zip_a " , "remote_a " ], indirect = ["store" ])
116+ @pytest .mark .parametrize ("store" , ["local " , "memory " , "zip " , "remote " ], indirect = ["store" ])
119117@pytest .mark .parametrize ("zarr_format" , [2 , 3 ])
120118def test_array_name_properties_no_group (
121119 store : LocalStore | MemoryStore , zarr_format : ZarrFormat
@@ -126,7 +124,7 @@ def test_array_name_properties_no_group(
126124 assert arr .basename is None
127125
128126
129- @pytest .mark .parametrize ("store" , ["local_a " , "memory_a " , "zip_a " ], indirect = ["store" ])
127+ @pytest .mark .parametrize ("store" , ["local " , "memory " , "zip " ], indirect = ["store" ])
130128@pytest .mark .parametrize ("zarr_format" , [2 , 3 ])
131129def test_array_name_properties_with_group (
132130 store : LocalStore | MemoryStore , zarr_format : ZarrFormat
@@ -145,7 +143,7 @@ def test_array_name_properties_with_group(
145143 assert spam .basename == "spam"
146144
147145
148- @pytest .mark .parametrize ("store" , ["memory_a " ], indirect = True )
146+ @pytest .mark .parametrize ("store" , ["memory " ], indirect = True )
149147@pytest .mark .parametrize ("specifiy_fill_value" , [True , False ])
150148@pytest .mark .parametrize ("dtype_str" , ["bool" , "uint8" , "complex64" ])
151149def test_array_v3_fill_value_default (
@@ -175,7 +173,7 @@ def test_array_v3_fill_value_default(
175173 assert arr .fill_value .dtype == arr .dtype
176174
177175
178- @pytest .mark .parametrize ("store" , ["memory_a " ], indirect = True )
176+ @pytest .mark .parametrize ("store" , ["memory " ], indirect = True )
179177@pytest .mark .parametrize (
180178 ("dtype_str" , "fill_value" ),
181179 [("bool" , True ), ("uint8" , 99 ), ("float32" , - 99.9 ), ("complex64" , 3 + 4j )],
@@ -236,7 +234,7 @@ def test_selection_positional_args_deprecated() -> None:
236234 arr .set_block_selection ((0 , slice (None )), 1 , None )
237235
238236
239- @pytest .mark .parametrize ("store" , ["memory_a " ], indirect = True )
237+ @pytest .mark .parametrize ("store" , ["memory " ], indirect = True )
240238async def test_array_v3_nan_fill_value (store : MemoryStore ) -> None :
241239 shape = (10 ,)
242240 arr = Array .create (
@@ -255,7 +253,7 @@ async def test_array_v3_nan_fill_value(store: MemoryStore) -> None:
255253 assert len ([a async for a in store .list_prefix ("/" )]) == 0
256254
257255
258- @pytest .mark .parametrize ("store" , ["local_a " ], indirect = ["store" ])
256+ @pytest .mark .parametrize ("store" , ["local " ], indirect = ["store" ])
259257@pytest .mark .parametrize ("zarr_format" , [2 , 3 ])
260258async def test_serializable_async_array (
261259 store : LocalStore | MemoryStore , zarr_format : ZarrFormat
@@ -273,7 +271,7 @@ async def test_serializable_async_array(
273271 # TODO: uncomment the parts of this test that will be impacted by the config/prototype changes in flight
274272
275273
276- @pytest .mark .parametrize ("store" , ["local_a " ], indirect = ["store" ])
274+ @pytest .mark .parametrize ("store" , ["local " ], indirect = ["store" ])
277275@pytest .mark .parametrize ("zarr_format" , [2 , 3 ])
278276def test_serializable_sync_array (store : LocalStore , zarr_format : ZarrFormat ) -> None :
279277 expected = Array .create (
@@ -288,7 +286,7 @@ def test_serializable_sync_array(store: LocalStore, zarr_format: ZarrFormat) ->
288286 np .testing .assert_array_equal (actual [:], expected [:])
289287
290288
291- @pytest .mark .parametrize ("store" , ["memory_a " ], indirect = True )
289+ @pytest .mark .parametrize ("store" , ["memory " ], indirect = True )
292290def test_storage_transformers (store : MemoryStore ) -> None :
293291 """
294292 Test that providing an actual storage transformer produces a warning and otherwise passes through
@@ -418,7 +416,7 @@ def test_update_attrs(zarr_format: int) -> None:
418416 assert arr2 .attrs ["foo" ] == "bar"
419417
420418
421- @pytest .mark .parametrize ("store" , ["memory_a " ], indirect = True )
419+ @pytest .mark .parametrize ("store" , ["memory " ], indirect = True )
422420@pytest .mark .parametrize ("zarr_format" , [2 , 3 ])
423421def test_resize_1d (store : MemoryStore , zarr_format : int ) -> None :
424422 z = zarr .create (
@@ -457,7 +455,7 @@ def test_resize_1d(store: MemoryStore, zarr_format: int) -> None:
457455 assert new_shape == z [:].shape
458456
459457
460- @pytest .mark .parametrize ("store" , ["memory_a " ], indirect = True )
458+ @pytest .mark .parametrize ("store" , ["memory " ], indirect = True )
461459@pytest .mark .parametrize ("zarr_format" , [2 , 3 ])
462460def test_resize_2d (store : MemoryStore , zarr_format : int ) -> None :
463461 z = zarr .create (
@@ -519,7 +517,7 @@ def test_resize_2d(store: MemoryStore, zarr_format: int) -> None:
519517 assert new_shape == z [:].shape
520518
521519
522- @pytest .mark .parametrize ("store" , ["memory_a " ], indirect = True )
520+ @pytest .mark .parametrize ("store" , ["memory " ], indirect = True )
523521@pytest .mark .parametrize ("zarr_format" , [2 , 3 ])
524522def test_append_1d (store : MemoryStore , zarr_format : int ) -> None :
525523 a = np .arange (105 )
@@ -549,7 +547,7 @@ def test_append_1d(store: MemoryStore, zarr_format: int) -> None:
549547 np .testing .assert_array_equal (f , z [:])
550548
551549
552- @pytest .mark .parametrize ("store" , ["memory_a " ], indirect = True )
550+ @pytest .mark .parametrize ("store" , ["memory " ], indirect = True )
553551@pytest .mark .parametrize ("zarr_format" , [2 , 3 ])
554552def test_append_2d (store : MemoryStore , zarr_format : int ) -> None :
555553 a = np .arange (105 * 105 , dtype = "i4" ).reshape ((105 , 105 ))
@@ -573,7 +571,7 @@ def test_append_2d(store: MemoryStore, zarr_format: int) -> None:
573571 np .testing .assert_array_equal (e , actual )
574572
575573
576- @pytest .mark .parametrize ("store" , ["memory_a " ], indirect = True )
574+ @pytest .mark .parametrize ("store" , ["memory " ], indirect = True )
577575@pytest .mark .parametrize ("zarr_format" , [2 , 3 ])
578576def test_append_2d_axis (store : MemoryStore , zarr_format : int ) -> None :
579577 a = np .arange (105 * 105 , dtype = "i4" ).reshape ((105 , 105 ))
@@ -595,7 +593,7 @@ def test_append_2d_axis(store: MemoryStore, zarr_format: int) -> None:
595593 np .testing .assert_array_equal (e , z [:])
596594
597595
598- @pytest .mark .parametrize ("store" , ["memory_a " ], indirect = True )
596+ @pytest .mark .parametrize ("store" , ["memory " ], indirect = True )
599597@pytest .mark .parametrize ("zarr_format" , [2 , 3 ])
600598def test_append_bad_shape (store : MemoryStore , zarr_format : int ) -> None :
601599 a = np .arange (100 )
@@ -608,7 +606,7 @@ def test_append_bad_shape(store: MemoryStore, zarr_format: int) -> None:
608606
609607@pytest .mark .parametrize ("order" , ["C" , "F" , None ])
610608@pytest .mark .parametrize ("zarr_format" , [2 , 3 ])
611- @pytest .mark .parametrize ("store" , ["memory_a " ], indirect = True )
609+ @pytest .mark .parametrize ("store" , ["memory " ], indirect = True )
612610def test_array_create_order (
613611 order : MemoryOrder | None , zarr_format : int , store : MemoryStore
614612) -> None :
0 commit comments