Skip to content

Commit

Permalink
Missing mandatory keyword argument
Browse files Browse the repository at this point in the history
The keyword argument `shape` is mandatory.
  • Loading branch information
DimitriPapadopoulos committed Nov 5, 2024
1 parent ca46bab commit 7653340
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/zarr/core/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ async def create_array(

@deprecated("Use AsyncGroup.create_array instead.")
async def create_dataset(
self, name: str, **kwargs: Any
self, name: str, *, shape: ShapeLike, **kwargs: Any
) -> AsyncArray[ArrayV2Metadata] | AsyncArray[ArrayV3Metadata]:
"""Create an array.
Expand All @@ -988,7 +988,7 @@ async def create_dataset(
.. deprecated:: 3.0.0
The h5py compatibility methods will be removed in 3.1.0. Use `AsyncGroup.create_array` instead.
"""
return await self.create_array(name, **kwargs)
return await self.create_array(name, shape=shape, **kwargs)

@deprecated("Use AsyncGroup.require_array instead.")
async def require_dataset(
Expand Down Expand Up @@ -1666,7 +1666,7 @@ def create_dataset(self, name: str, **kwargs: Any) -> Array:
return Array(self._sync(self._async_group.create_dataset(name, **kwargs)))

@deprecated("Use Group.require_array instead.")
def require_dataset(self, name: str, **kwargs: Any) -> Array:
def require_dataset(self, name: str, *, shape: ShapeLike, **kwargs: Any) -> Array:
"""Obtain an array, creating if it doesn't exist.
Arrays are known as "datasets" in HDF5 terminology. For compatibility
Expand All @@ -1688,9 +1688,9 @@ def require_dataset(self, name: str, **kwargs: Any) -> Array:
.. deprecated:: 3.0.0
The h5py compatibility methods will be removed in 3.1.0. Use `Group.require_array` instead.
"""
return Array(self._sync(self._async_group.require_array(name, **kwargs)))
return Array(self._sync(self._async_group.require_array(name, shape=shape, **kwargs)))

def require_array(self, name: str, **kwargs: Any) -> Array:
def require_array(self, name: str, *, shape: ShapeLike, **kwargs: Any) -> Array:
"""Obtain an array, creating if it doesn't exist.
Expand All @@ -1707,7 +1707,7 @@ def require_array(self, name: str, **kwargs: Any) -> Array:
-------
a : Array
"""
return Array(self._sync(self._async_group.require_array(name, **kwargs)))
return Array(self._sync(self._async_group.require_array(name, shape=shape, **kwargs)))

@_deprecate_positional_args
def empty(self, *, name: str, shape: ChunkCoords, **kwargs: Any) -> Array:
Expand Down

0 comments on commit 7653340

Please sign in to comment.