Skip to content

Commit

Permalink
Improve deprecation of zarr.creation and zarr.convenience (#2609)
Browse files Browse the repository at this point in the history
  • Loading branch information
dstansby authored Jan 2, 2025
1 parent f407a41 commit 7907852
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
12 changes: 11 additions & 1 deletion src/zarr/convenience.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
"""
Convenience helpers.
.. warning::
This sub-module is deprecated. All functions here are defined
in the top level zarr namespace instead.
"""

import warnings

from zarr.api.synchronous import (
Expand Down Expand Up @@ -29,7 +38,8 @@
]

warnings.warn(
"zarr.convenience is deprecated, use zarr.api.synchronous",
"zarr.convenience is deprecated. "
"Import these functions from the top level zarr. namespace instead.",
DeprecationWarning,
stacklevel=2,
)
12 changes: 11 additions & 1 deletion src/zarr/creation.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
"""
Helpers for creating arrays.
.. warning::
This sub-module is deprecated. All functions here are defined
in the top level zarr namespace instead.
"""

import warnings

from zarr.api.synchronous import (
Expand Down Expand Up @@ -31,7 +40,8 @@
]

warnings.warn(
"zarr.creation is deprecated, use zarr.api.synchronous",
"zarr.creation is deprecated. "
"Import these functions from the top level zarr. namespace instead.",
DeprecationWarning,
stacklevel=2,
)

0 comments on commit 7907852

Please sign in to comment.