diff --git a/pyproject.toml b/pyproject.toml index aaedc09736..0fa0e7b6b4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -397,7 +397,8 @@ ignore = [ checks = [ "GL06", "GL07", - "GL09", + # Currently broken; see https://github.com/numpy/numpydoc/issues/573 + # "GL09", "GL10", "SS02", "SS04", diff --git a/src/zarr/api/asynchronous.py b/src/zarr/api/asynchronous.py index f54a824088..f42b6d3f51 100644 --- a/src/zarr/api/asynchronous.py +++ b/src/zarr/api/asynchronous.py @@ -508,6 +508,10 @@ async def save_group( async def tree(grp: AsyncGroup, expand: bool | None = None, level: int | None = None) -> Any: """Provide a rich display of the hierarchy. + .. deprecated:: 3.0.0 + `zarr.tree()` is deprecated and will be removed in a future release. + Use `group.tree()` instead. + Parameters ---------- grp : Group @@ -521,10 +525,6 @@ async def tree(grp: AsyncGroup, expand: bool | None = None, level: int | None = ------- TreeRepr A pretty-printable object displaying the hierarchy. - - .. deprecated:: 3.0.0 - `zarr.tree()` is deprecated and will be removed in a future release. - Use `group.tree()` instead. """ return await grp.tree(expand=expand, level=level) diff --git a/src/zarr/api/synchronous.py b/src/zarr/api/synchronous.py index e4a842ef8f..200db9ec26 100644 --- a/src/zarr/api/synchronous.py +++ b/src/zarr/api/synchronous.py @@ -334,6 +334,10 @@ def save_group( def tree(grp: Group, expand: bool | None = None, level: int | None = None) -> Any: """Provide a rich display of the hierarchy. + .. deprecated:: 3.0.0 + `zarr.tree()` is deprecated and will be removed in a future release. + Use `group.tree()` instead. + Parameters ---------- grp : Group @@ -347,10 +351,6 @@ def tree(grp: Group, expand: bool | None = None, level: int | None = None) -> An ------- TreeRepr A pretty-printable object displaying the hierarchy. - - .. deprecated:: 3.0.0 - `zarr.tree()` is deprecated and will be removed in a future release. - Use `group.tree()` instead. """ return sync(async_api.tree(grp._async_group, expand=expand, level=level)) diff --git a/src/zarr/core/array.py b/src/zarr/core/array.py index 20e7f729aa..e5c4e4538c 100644 --- a/src/zarr/core/array.py +++ b/src/zarr/core/array.py @@ -432,6 +432,9 @@ async def create( ) -> AsyncArray[ArrayV2Metadata] | AsyncArray[ArrayV3Metadata]: """Method to create a new asynchronous array instance. + .. deprecated:: 3.0.0 + Deprecated in favor of :func:`zarr.api.asynchronous.create_array`. + Parameters ---------- store : StoreLike @@ -509,9 +512,6 @@ async def create( ------- AsyncArray The created asynchronous array instance. - - .. deprecated:: 3.0.0 - Deprecated in favor of :func:`zarr.api.asynchronous.create_array`. """ return await cls._create( store, @@ -1631,6 +1631,9 @@ def create( ) -> Array: """Creates a new Array instance from an initialized store. + .. deprecated:: 3.0.0 + Deprecated in favor of :func:`zarr.create_array`. + Parameters ---------- store : StoreLike @@ -1698,9 +1701,6 @@ def create( ------- Array Array created from the store. - - .. deprecated:: 3.0.0 - Deprecated in favor of :func:`zarr.create_array`. """ return cls._create( store, diff --git a/src/zarr/core/group.py b/src/zarr/core/group.py index 5cb42db5b4..a4503ce64e 100644 --- a/src/zarr/core/group.py +++ b/src/zarr/core/group.py @@ -1148,6 +1148,9 @@ async def create_dataset( ) -> AsyncArray[ArrayV2Metadata] | AsyncArray[ArrayV3Metadata]: """Create an array. + .. deprecated:: 3.0.0 + The h5py compatibility methods will be removed in 3.1.0. Use `AsyncGroup.create_array` instead. + Arrays are known as "datasets" in HDF5 terminology. For compatibility with h5py, Zarr groups also implement the :func:`zarr.AsyncGroup.require_dataset` method. @@ -1161,9 +1164,6 @@ async def create_dataset( Returns ------- a : AsyncArray - - .. deprecated:: 3.0.0 - The h5py compatibility methods will be removed in 3.1.0. Use `AsyncGroup.create_array` instead. """ data = kwargs.pop("data", None) # create_dataset in zarr 2.x requires shape but not dtype if data is @@ -1188,6 +1188,9 @@ async def require_dataset( ) -> AsyncArray[ArrayV2Metadata] | AsyncArray[ArrayV3Metadata]: """Obtain an array, creating if it doesn't exist. + .. deprecated:: 3.0.0 + The h5py compatibility methods will be removed in 3.1.0. Use `AsyncGroup.require_dataset` instead. + Arrays are known as "datasets" in HDF5 terminology. For compatibility with h5py, Zarr groups also implement the :func:`zarr.AsyncGroup.create_dataset` method. @@ -1208,9 +1211,6 @@ async def require_dataset( Returns ------- a : AsyncArray - - .. deprecated:: 3.0.0 - The h5py compatibility methods will be removed in 3.1.0. Use `AsyncGroup.require_dataset` instead. """ return await self.require_array(name, shape=shape, dtype=dtype, exact=exact, **kwargs) @@ -2402,6 +2402,10 @@ def create_array( def create_dataset(self, name: str, **kwargs: Any) -> Array: """Create an array. + .. deprecated:: 3.0.0 + The h5py compatibility methods will be removed in 3.1.0. Use `Group.create_array` instead. + + Arrays are known as "datasets" in HDF5 terminology. For compatibility with h5py, Zarr groups also implement the :func:`zarr.Group.require_dataset` method. @@ -2415,9 +2419,6 @@ def create_dataset(self, name: str, **kwargs: Any) -> Array: Returns ------- a : Array - - .. deprecated:: 3.0.0 - The h5py compatibility methods will be removed in 3.1.0. Use `Group.create_array` instead. """ return Array(self._sync(self._async_group.create_dataset(name, **kwargs))) @@ -2425,6 +2426,9 @@ def create_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. + .. deprecated:: 3.0.0 + The h5py compatibility methods will be removed in 3.1.0. Use `Group.require_array` instead. + Arrays are known as "datasets" in HDF5 terminology. For compatibility with h5py, Zarr groups also implement the :func:`zarr.Group.create_dataset` method. @@ -2440,9 +2444,6 @@ def require_dataset(self, name: str, *, shape: ShapeLike, **kwargs: Any) -> Arra Returns ------- a : 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, shape=shape, **kwargs))) @@ -2669,6 +2670,9 @@ def array( ) -> Array: """Create an array within this group. + .. deprecated:: 3.0.0 + Use `Group.create_array` instead. + This method lightly wraps :func:`zarr.core.array.create_array`. Parameters