@@ -295,36 +295,6 @@ def flatten(
295295 return metadata
296296
297297
298- class ArraysProxy :
299- """
300- Proxy for arrays in a group.
301-
302- Used to implement the `Group.arrays` property
303- """
304-
305- def __init__ (self , group : Group ) -> None :
306- self ._group = group
307-
308- def __getitem__ (self , key : str ) -> Array :
309- obj = self ._group [key ]
310- if isinstance (obj , Array ):
311- return obj
312- raise KeyError (key )
313-
314- def __setitem__ (self , key : str , value : npt .ArrayLike ) -> None :
315- """
316- Set an array in the group.
317- """
318- self ._group ._sync (self ._group ._async_group .set_array (key , value ))
319-
320- def __iter__ (self ) -> Generator [tuple [str , Array ], None ]:
321- for name , async_array in self ._group ._sync_iter (self ._group ._async_group .arrays ()):
322- yield name , Array (async_array )
323-
324- def __call__ (self ) -> Generator [tuple [str , Array ], None ]:
325- return iter (self )
326-
327-
328298@dataclass (frozen = True )
329299class GroupMetadata (Metadata ):
330300 attributes : dict [str , Any ] = field (default_factory = dict )
@@ -630,8 +600,10 @@ def from_dict(
630600 store_path = store_path ,
631601 )
632602
633- async def set_array (self , key : str , value : Any ) -> None :
634- """fastpath for creating a new array
603+ async def setitem (self , key : str , value : Any ) -> None :
604+ """Fastpath for creating a new array
605+
606+ New arrays will be created with default array settings for the array type.
635607
636608 Parameters
637609 ----------
@@ -1438,14 +1410,12 @@ def __iter__(self) -> Iterator[str]:
14381410 def __len__ (self ) -> int :
14391411 return self .nmembers ()
14401412
1441- @deprecated ("Use Group.arrays setter instead." )
14421413 def __setitem__ (self , key : str , value : Any ) -> None :
1443- """Create a new array
1414+ """Fastpath for creating a new array.
14441415
1445- .. deprecated:: 3.0.0
1446- Use Group.arrays.setter instead.
1416+ New arrays will be created using default settings for the array type.
14471417 """
1448- self ._sync (self ._async_group .set_array (key , value ))
1418+ self ._sync (self ._async_group .setitem (key , value ))
14491419
14501420 def __repr__ (self ) -> str :
14511421 return f"<Group { self .store_path } >"
@@ -1542,9 +1512,9 @@ def group_values(self) -> Generator[Group, None]:
15421512 for _ , group in self .groups ():
15431513 yield group
15441514
1545- @ property
1546- def arrays (self ) -> ArraysProxy :
1547- return ArraysProxy ( self )
1515+ def arrays ( self ) -> Generator [ tuple [ str , Array ], None ]:
1516+ for name , async_array in self . _sync_iter (self . _async_group . arrays ()) :
1517+ yield name , Array ( async_array )
15481518
15491519 def array_keys (self ) -> Generator [str , None ]:
15501520 for name , _ in self .arrays ():
0 commit comments