@@ -1299,16 +1299,66 @@ async def empty(
12991299 async def zeros (
13001300 self , * , name : str , shape : ChunkCoords , ** kwargs : Any
13011301 ) -> AsyncArray [ArrayV2Metadata ] | AsyncArray [ArrayV3Metadata ]:
1302+ """Create an array, with zero being used as the default value for uninitialized portions of the array.
1303+
1304+ Parameters
1305+ ----------
1306+ name : str
1307+ Name of the array.
1308+ shape : int or tuple of int
1309+ Shape of the empty array.
1310+ **kwargs
1311+ Keyword arguments passed to :func:`zarr.api.asynchronous.create`.
1312+
1313+ Returns
1314+ -------
1315+ AsyncArray
1316+ The new array.
1317+ """
13021318 return await async_api .zeros (shape = shape , store = self .store_path , path = name , ** kwargs )
13031319
13041320 async def ones (
13051321 self , * , name : str , shape : ChunkCoords , ** kwargs : Any
13061322 ) -> AsyncArray [ArrayV2Metadata ] | AsyncArray [ArrayV3Metadata ]:
1323+ """Create an array, with one being used as the default value for uninitialized portions of the array.
1324+
1325+ Parameters
1326+ ----------
1327+ name : str
1328+ Name of the array.
1329+ shape : int or tuple of int
1330+ Shape of the empty array.
1331+ **kwargs
1332+ Keyword arguments passed to :func:`zarr.api.asynchronous.create`.
1333+
1334+ Returns
1335+ -------
1336+ AsyncArray
1337+ The new array.
1338+ """
13071339 return await async_api .ones (shape = shape , store = self .store_path , path = name , ** kwargs )
13081340
13091341 async def full (
13101342 self , * , name : str , shape : ChunkCoords , fill_value : Any | None , ** kwargs : Any
13111343 ) -> AsyncArray [ArrayV2Metadata ] | AsyncArray [ArrayV3Metadata ]:
1344+ """Create an array, with "fill_value" being used as the default value for uninitialized portions of the array.
1345+
1346+ Parameters
1347+ ----------
1348+ name : str
1349+ Name of the array.
1350+ shape : int or tuple of int
1351+ Shape of the empty array.
1352+ fill_value : scalar
1353+ Value to fill the array with.
1354+ **kwargs
1355+ Keyword arguments passed to :func:`zarr.api.asynchronous.create`.
1356+
1357+ Returns
1358+ -------
1359+ AsyncArray
1360+ The new array.
1361+ """
13121362 return await async_api .full (
13131363 shape = shape ,
13141364 fill_value = fill_value ,
@@ -1320,24 +1370,89 @@ async def full(
13201370 async def empty_like (
13211371 self , * , name : str , data : async_api .ArrayLike , ** kwargs : Any
13221372 ) -> AsyncArray [ArrayV2Metadata ] | AsyncArray [ArrayV3Metadata ]:
1373+ """Create an empty sub-array like `data`.
1374+
1375+ Parameters
1376+ ----------
1377+ name : str
1378+ Name of the array.
1379+ data : array-like
1380+ The array to create an empty array like.
1381+ **kwargs
1382+ Keyword arguments passed to :func:`zarr.api.asynchronous.create`.
1383+
1384+ Returns
1385+ -------
1386+ AsyncArray
1387+ The new array.
1388+ """
13231389 return await async_api .empty_like (a = data , store = self .store_path , path = name , ** kwargs )
13241390
13251391 async def zeros_like (
13261392 self , * , name : str , data : async_api .ArrayLike , ** kwargs : Any
13271393 ) -> AsyncArray [ArrayV2Metadata ] | AsyncArray [ArrayV3Metadata ]:
1394+ """Create a sub-array of zeros like `data`.
1395+
1396+ Parameters
1397+ ----------
1398+ name : str
1399+ Name of the array.
1400+ data : array-like
1401+ The array to create the new array like.
1402+ **kwargs
1403+ Keyword arguments passed to :func:`zarr.api.asynchronous.create`.
1404+
1405+ Returns
1406+ -------
1407+ AsyncArray
1408+ The new array.
1409+ """
13281410 return await async_api .zeros_like (a = data , store = self .store_path , path = name , ** kwargs )
13291411
13301412 async def ones_like (
13311413 self , * , name : str , data : async_api .ArrayLike , ** kwargs : Any
13321414 ) -> AsyncArray [ArrayV2Metadata ] | AsyncArray [ArrayV3Metadata ]:
1415+ """Create a sub-array of ones like `data`.
1416+
1417+ Parameters
1418+ ----------
1419+ name : str
1420+ Name of the array.
1421+ data : array-like
1422+ The array to create the new array like.
1423+ **kwargs
1424+ Keyword arguments passed to :func:`zarr.api.asynchronous.create`.
1425+
1426+ Returns
1427+ -------
1428+ AsyncArray
1429+ The new array.
1430+ """
13331431 return await async_api .ones_like (a = data , store = self .store_path , path = name , ** kwargs )
13341432
13351433 async def full_like (
13361434 self , * , name : str , data : async_api .ArrayLike , ** kwargs : Any
13371435 ) -> AsyncArray [ArrayV2Metadata ] | AsyncArray [ArrayV3Metadata ]:
1436+ """Create a sub-array like `data` filled with the `fill_value` of `data` .
1437+
1438+ Parameters
1439+ ----------
1440+ name : str
1441+ Name of the array.
1442+ data : array-like
1443+ The array to create the new array like.
1444+ **kwargs
1445+ Keyword arguments passed to :func:`zarr.api.asynchronous.create`.
1446+
1447+ Returns
1448+ -------
1449+ AsyncArray
1450+ The new array.
1451+ """
13381452 return await async_api .full_like (a = data , store = self .store_path , path = name , ** kwargs )
13391453
13401454 async def move (self , source : str , dest : str ) -> None :
1455+ """not implemented"""
13411456 raise NotImplementedError
13421457
13431458
@@ -1743,9 +1858,28 @@ def array_values(self) -> Generator[Array, None]:
17431858 yield array
17441859
17451860 def tree (self , expand : bool = False , level : int | None = None ) -> Any :
1861+ """not implemented"""
17461862 return self ._sync (self ._async_group .tree (expand = expand , level = level ))
17471863
17481864 def create_group (self , name : str , ** kwargs : Any ) -> Group :
1865+ """Create a sub-group.
1866+ Parameters
1867+ ----------
1868+ name : str
1869+ Name of the new subgroup.
1870+
1871+ Returns
1872+ -------
1873+ Group
1874+
1875+ Examples
1876+ --------
1877+ >>> import zarr
1878+ >>> group = zarr.group()
1879+ >>> subgroup = group.create_group("subgroup")
1880+ >>> subgroup
1881+ <Group memory://132270269438272/subgroup>
1882+ """
17491883 return Group (self ._sync (self ._async_group .create_group (name , ** kwargs )))
17501884
17511885 def require_group (self , name : str , ** kwargs : Any ) -> Group :
@@ -1934,20 +2068,87 @@ def require_array(self, name: str, **kwargs: Any) -> Array:
19342068
19352069 @_deprecate_positional_args
19362070 def empty (self , * , name : str , shape : ChunkCoords , ** kwargs : Any ) -> Array :
2071+ """Create an empty array in this Group.
2072+
2073+ Parameters
2074+ ----------
2075+ name : str
2076+ Name of the array.
2077+ shape : int or tuple of int
2078+ Shape of the empty array.
2079+ **kwargs
2080+ Keyword arguments passed to :func:`zarr.api.asynchronous.create`.
2081+
2082+ Notes
2083+ -----
2084+ The contents of an empty Zarr array are not defined. On attempting to
2085+ retrieve data from an empty Zarr array, any values may be returned,
2086+ and these are not guaranteed to be stable from one access to the next.
2087+ """
19372088 return Array (self ._sync (self ._async_group .empty (name = name , shape = shape , ** kwargs )))
19382089
19392090 @_deprecate_positional_args
19402091 def zeros (self , * , name : str , shape : ChunkCoords , ** kwargs : Any ) -> Array :
2092+ """Create an array, with zero being used as the default value for uninitialized portions of the array.
2093+
2094+ Parameters
2095+ ----------
2096+ name : str
2097+ Name of the array.
2098+ shape : int or tuple of int
2099+ Shape of the empty array.
2100+ **kwargs
2101+ Keyword arguments passed to :func:`zarr.api.asynchronous.create`.
2102+
2103+ Returns
2104+ -------
2105+ Array
2106+ The new array.
2107+ """
19412108 return Array (self ._sync (self ._async_group .zeros (name = name , shape = shape , ** kwargs )))
19422109
19432110 @_deprecate_positional_args
19442111 def ones (self , * , name : str , shape : ChunkCoords , ** kwargs : Any ) -> Array :
2112+ """Create an array, with one being used as the default value for uninitialized portions of the array.
2113+
2114+ Parameters
2115+ ----------
2116+ name : str
2117+ Name of the array.
2118+ shape : int or tuple of int
2119+ Shape of the empty array.
2120+ **kwargs
2121+ Keyword arguments passed to :func:`zarr.api.asynchronous.create`.
2122+
2123+ Returns
2124+ -------
2125+ Array
2126+ The new array.
2127+ """
19452128 return Array (self ._sync (self ._async_group .ones (name = name , shape = shape , ** kwargs )))
19462129
19472130 @_deprecate_positional_args
19482131 def full (
19492132 self , * , name : str , shape : ChunkCoords , fill_value : Any | None , ** kwargs : Any
19502133 ) -> Array :
2134+ """Create an array, with "fill_value" being used as the default value for uninitialized portions of the array.
2135+
2136+ Parameters
2137+ ----------
2138+ name : str
2139+ Name of the array.
2140+ shape : int or tuple of int
2141+ Shape of the empty array.
2142+ fill_value : scalar
2143+ Value to fill the array with.
2144+ **kwargs
2145+ Keyword arguments passed to :func:`zarr.api.asynchronous.create`.
2146+
2147+ Returns
2148+ -------
2149+ Array
2150+ The new array.
2151+ """
19512152 return Array (
19522153 self ._sync (
19532154 self ._async_group .full (name = name , shape = shape , fill_value = fill_value , ** kwargs )
@@ -1956,21 +2157,87 @@ def full(
19562157
19572158 @_deprecate_positional_args
19582159 def empty_like (self , * , name : str , data : async_api .ArrayLike , ** kwargs : Any ) -> Array :
2160+ """Create an empty sub-array like `data`.
2161+
2162+ Parameters
2163+ ----------
2164+ name : str
2165+ Name of the array.
2166+ data : array-like
2167+ The array to create an empty array like.
2168+ **kwargs
2169+ Keyword arguments passed to :func:`zarr.api.asynchronous.create`.
2170+
2171+ Returns
2172+ -------
2173+ Array
2174+ The new array.
2175+ """
19592176 return Array (self ._sync (self ._async_group .empty_like (name = name , data = data , ** kwargs )))
19602177
19612178 @_deprecate_positional_args
19622179 def zeros_like (self , * , name : str , data : async_api .ArrayLike , ** kwargs : Any ) -> Array :
2180+ """Create a sub-array of zeros like `data`.
2181+
2182+ Parameters
2183+ ----------
2184+ name : str
2185+ Name of the array.
2186+ data : array-like
2187+ The array to create the new array like.
2188+ **kwargs
2189+ Keyword arguments passed to :func:`zarr.api.asynchronous.create`.
2190+
2191+ Returns
2192+ -------
2193+ Array
2194+ The new array.
2195+ """
2196+
19632197 return Array (self ._sync (self ._async_group .zeros_like (name = name , data = data , ** kwargs )))
19642198
19652199 @_deprecate_positional_args
19662200 def ones_like (self , * , name : str , data : async_api .ArrayLike , ** kwargs : Any ) -> Array :
2201+ """Create a sub-array of ones like `data`.
2202+
2203+ Parameters
2204+ ----------
2205+ name : str
2206+ Name of the array.
2207+ data : array-like
2208+ The array to create the new array like.
2209+ **kwargs
2210+ Keyword arguments passed to :func:`zarr.api.asynchronous.create`.
2211+
2212+ Returns
2213+ -------
2214+ Array
2215+ The new array.
2216+ """
19672217 return Array (self ._sync (self ._async_group .ones_like (name = name , data = data , ** kwargs )))
19682218
19692219 @_deprecate_positional_args
19702220 def full_like (self , * , name : str , data : async_api .ArrayLike , ** kwargs : Any ) -> Array :
2221+ """Create a sub-array like `data` filled with the `fill_value` of `data` .
2222+
2223+ Parameters
2224+ ----------
2225+ name : str
2226+ Name of the array.
2227+ data : array-like
2228+ The array to create the new array like.
2229+ **kwargs
2230+ Keyword arguments passed to :func:`zarr.api.asynchronous.create`.
2231+
2232+ Returns
2233+ -------
2234+ Array
2235+ The new array.
2236+ """
19712237 return Array (self ._sync (self ._async_group .full_like (name = name , data = data , ** kwargs )))
19722238
19732239 def move (self , source : str , dest : str ) -> None :
2240+ """not implemented"""
19742241 return self ._sync (self ._async_group .move (source , dest ))
19752242
19762243 @deprecated ("Use Group.create_array instead." )
0 commit comments