@@ -1174,29 +1174,32 @@ def require_dataset(
1174
1174
dtype : npt .DTypeLike = None ,
1175
1175
exact : bool = False ,
1176
1176
** kwargs : Any ,
1177
- ) -> AsyncArray [ ArrayV2Metadata ] | AsyncArray [ ArrayV3Metadata ] :
1177
+ ) -> Array :
1178
1178
"""Obtain an array, creating if it doesn't exist.
1179
1179
1180
1180
.. deprecated:: 3.0.0
1181
1181
The h5py compatibility methods will be removed in 3.1.0. Use `Group.require_array` instead.
1182
1182
1183
1183
Arrays are known as "datasets" in HDF5 terminology. For compatibility
1184
- with h5py, Zarr groups also implement the :func:`zarr.AsyncGroup .create_dataset` method.
1184
+ with h5py, Zarr groups also implement the :func:`zarr.Group .create_dataset` method.
1185
1185
1186
- Other `kwargs` are as per :func:`zarr.AsyncGroup .create_array`.
1186
+ Other `kwargs` are as per :func:`zarr.Group .create_array`.
1187
1187
1188
1188
Parameters
1189
1189
----------
1190
1190
name : str
1191
1191
Array name.
1192
1192
shape : int or tuple of ints
1193
1193
Array shape.
1194
- **kwargs
1195
- Additional keyword arguments passed to :func:`zarr.AsyncGroup.create_array`.
1194
+ dtype : str or dtype, optional
1195
+ NumPy dtype. If None, the dtype will be inferred from the existing array.
1196
+ exact : bool, optional
1197
+ If True, require `dtype` to match exactly. If False, require
1198
+ `dtype` can be cast from array dtype.
1196
1199
1197
1200
Returns
1198
1201
-------
1199
- a : AsyncArray
1202
+ a : Array
1200
1203
"""
1201
1204
return self .require_array (name , shape = shape , dtype = dtype , exact = exact , ** kwargs )
1202
1205
@@ -2554,9 +2557,9 @@ def require_dataset(
2554
2557
shape : int or tuple of ints
2555
2558
Array shape.
2556
2559
dtype : str or dtype, optional
2557
- NumPy dtype.
2560
+ NumPy dtype. If None, the dtype will be inferred from the existing array.
2558
2561
exact : bool, optional
2559
- If True, require `dtype` to match exactly. If false , require
2562
+ If True, require `dtype` to match exactly. If False , require
2560
2563
`dtype` can be cast from array dtype.
2561
2564
2562
2565
Returns
@@ -2592,9 +2595,15 @@ def require_array(
2592
2595
2593
2596
Returns
2594
2597
-------
2595
- a : Array
2598
+ a : AsyncArray
2596
2599
"""
2597
- return Array (self ._sync (self ._async_group .require_array (name , shape = shape , dtype = dtype , exact = exact , ** kwargs )))
2600
+ return Array (
2601
+ self ._sync (
2602
+ self ._async_group .require_array (
2603
+ name , shape = shape , dtype = dtype , exact = exact , ** kwargs
2604
+ )
2605
+ )
2606
+ )
2598
2607
2599
2608
@_deprecate_positional_args
2600
2609
def empty (self , * , name : str , shape : ChunkCoords , ** kwargs : Any ) -> Array :
0 commit comments