Skip to content

Deprecate empty offsets in get_path_collection_extents #23200

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions doc/api/next_api_changes/deprecations/23200-OG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Calling ``paths.get_path_collection_extents`` with empty *offsets*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Calling `~.get_path_collection_extents` with an empty *offsets* parameter
has an ambiguous interpretation and is therefore deprecated. When the
deprecation period expires, this will produce an error.
5 changes: 5 additions & 0 deletions lib/matplotlib/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,11 @@ def get_path_collection_extents(
from .transforms import Bbox
if len(paths) == 0:
raise ValueError("No paths provided")
if len(offsets) == 0:
_api.warn_deprecated(
"3.8", message="Calling get_path_collection_extents() with an"
" empty offsets list is deprecated since %(since)s. Support will"
" be removed %(removal)s.")
extents, minpos = _path.get_path_collection_extents(
master_transform, paths, np.atleast_3d(transforms),
offsets, offset_transform)
Expand Down