Skip to content

Commit 4c1eda7

Browse files
committed
Error on empty offsets in get_path_collection_extents
1 parent 028f07c commit 4c1eda7

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Calling ``paths.get_path_collection_extents`` with empty ``offsets``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
Calling `~.get_path_collection_extents` with an empty ``offsets`` parameter
5+
has an ambiguous interpretation and is therefore deprecated. When the
6+
deprecation period expires, this will produce an error.

lib/matplotlib/path.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,6 +1065,11 @@ def get_path_collection_extents(
10651065
from .transforms import Bbox
10661066
if len(paths) == 0:
10671067
raise ValueError("No paths provided")
1068+
if len(offsets) == 0:
1069+
_api.warn_deprecated(
1070+
"3.6", message="Calling get_path_collection_extents() with an"
1071+
" empty offsets list is deprecated since %(since)s. Support will"
1072+
" be removed %(removal)s.")
10681073
extents, minpos = _path.get_path_collection_extents(
10691074
master_transform, paths, np.atleast_3d(transforms),
10701075
offsets, offset_transform)

0 commit comments

Comments
 (0)