Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f7526ba

Browse files
committed
Deprecate empty offsets in get_path_collection_extents
1 parent 73394f2 commit f7526ba

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
@@ -1068,6 +1068,11 @@ def get_path_collection_extents(
10681068
from .transforms import Bbox
10691069
if len(paths) == 0:
10701070
raise ValueError("No paths provided")
1071+
if len(offsets) == 0:
1072+
_api.warn_deprecated(
1073+
"3.8", message="Calling get_path_collection_extents() with an"
1074+
" empty offsets list is deprecated since %(since)s. Support will"
1075+
" be removed %(removal)s.")
10711076
extents, minpos = _path.get_path_collection_extents(
10721077
master_transform, paths, np.atleast_3d(transforms),
10731078
offsets, offset_transform)

0 commit comments

Comments
 (0)