1313from zarr import AsyncGroup
1414from zarr .api .asynchronous import (
1515 consolidate_metadata ,
16- group ,
16+ create_group ,
1717 open ,
1818 open_consolidated ,
19+ open_group ,
1920)
2021from zarr .core .buffer import cpu , default_buffer_prototype
2122from zarr .core .dtype import parse_dtype
3233
3334@pytest .fixture
3435async def memory_store_with_hierarchy (memory_store : Store ) -> Store :
35- g = await group (store = memory_store , attributes = {"foo" : "bar" })
36+ g = await create_group (store = memory_store , attributes = {"foo" : "bar" })
3637 dtype = "uint8"
3738 await g .create_array (name = "air" , shape = (1 , 2 , 3 ), dtype = dtype )
3839 await g .create_array (name = "lat" , shape = (1 ,), dtype = dtype )
@@ -212,7 +213,7 @@ async def test_consolidated(self, memory_store_with_hierarchy: Store) -> None:
212213 ]
213214
214215 def test_consolidated_sync (self , memory_store : Store ) -> None :
215- g = zarr .api .synchronous .group (store = memory_store , attributes = {"foo" : "bar" })
216+ g = zarr .api .synchronous .create_group (store = memory_store , attributes = {"foo" : "bar" })
216217 dtype = "uint8"
217218 g .create_array (name = "air" , shape = (1 , 2 , 3 ), dtype = dtype )
218219 g .create_array (name = "lat" , shape = (1 ,), dtype = dtype )
@@ -300,7 +301,7 @@ def test_consolidated_sync(self, memory_store: Store) -> None:
300301 assert group4 .metadata == expected
301302
302303 async def test_not_writable_raises (self , memory_store : zarr .storage .MemoryStore ) -> None :
303- await group (store = memory_store , attributes = {"foo" : "bar" })
304+ await create_group (store = memory_store , attributes = {"foo" : "bar" })
304305 read_store = zarr .storage .MemoryStore (store_dict = memory_store ._store_dict , read_only = True )
305306 with pytest .raises (ValueError , match = "does not support writing" ):
306307 await consolidate_metadata (read_store )
@@ -485,7 +486,7 @@ async def test_to_dict_order(
485486 self , memory_store : zarr .storage .MemoryStore , zarr_format : ZarrFormat
486487 ) -> None :
487488 with zarr .config .set (default_zarr_format = zarr_format ):
488- g = await group (store = memory_store )
489+ g = await create_group (store = memory_store )
489490
490491 # Create groups in non-lexicographix order
491492 dtype = "float32"
@@ -602,7 +603,7 @@ async def test_use_consolidated_false(
602603 self , memory_store : zarr .storage .MemoryStore , zarr_format : ZarrFormat
603604 ) -> None :
604605 with zarr .config .set (default_zarr_format = zarr_format ):
605- g = await group (store = memory_store , attributes = {"foo" : "bar" })
606+ g = await create_group (store = memory_store , attributes = {"foo" : "bar" })
606607 await g .create_group (name = "a" )
607608
608609 # test a stale read
@@ -648,7 +649,7 @@ async def test_stale_child_metadata_ignored(
648649 # https://github.com/zarr-developers/zarr-python/issues/2921
649650 # When consolidating metadata, we should ignore any (possibly stale) metadata
650651 # from previous consolidations, *including at child nodes*.
651- root = await zarr .api .asynchronous .group (store = memory_store , zarr_format = 3 )
652+ root = await zarr .api .asynchronous .create_group (store = memory_store , zarr_format = 3 )
652653 await root .create_group ("foo" )
653654 await zarr .api .asynchronous .consolidate_metadata (memory_store , path = "foo" )
654655 await root .create_group ("foo/bar/spam" )
@@ -712,7 +713,7 @@ async def test_absolute_path_for_subgroup(self, memory_store: zarr.storage.Memor
712713async def test_consolidated_metadata_encodes_special_chars (
713714 memory_store : Store , zarr_format : ZarrFormat , fill_value : float
714715) -> None :
715- root = await group (store = memory_store , zarr_format = zarr_format )
716+ root = await create_group (store = memory_store , zarr_format = zarr_format )
716717 _time = await root .create_array ("time" , shape = (12 ,), dtype = np .float64 , fill_value = fill_value )
717718 if zarr_format == 3 :
718719 with pytest .warns (
@@ -723,7 +724,7 @@ async def test_consolidated_metadata_encodes_special_chars(
723724 else :
724725 await zarr .api .asynchronous .consolidate_metadata (memory_store )
725726
726- root = await group (store = memory_store , zarr_format = zarr_format )
727+ root = await open_group (store = memory_store , zarr_format = zarr_format )
727728 root_buffer = root .metadata .to_buffer_dict (default_buffer_prototype ())
728729
729730 if zarr_format == 2 :
0 commit comments