Skip to content

Commit 41ee6b2

Browse files
committed
Delay warning for deprecated parameter 'vert' of box and violin
The new parameter, 'orientation', was only added in the current release, so downstream wanting to avoid warnings would require version gates. Therefore delaying by at least one release to ease the transition. This was motivated by Pandas failing tests on this warning.
1 parent 183b04f commit 41ee6b2

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4360,11 +4360,15 @@ def merge_kw_rc(subkey, explicit, zdelta=0, usemarker=True):
43604360
if vert is None:
43614361
vert = mpl.rcParams['boxplot.vertical']
43624362
else:
4363-
_api.warn_deprecated(
4364-
"3.10",
4365-
name="vert: bool",
4366-
alternative="orientation: {'vertical', 'horizontal'}"
4367-
)
4363+
pass
4364+
# Deprecation warning delayed as the alternative was only introduced in 3.10
4365+
#
4366+
# _api.warn_deprecated(
4367+
# "3.11",
4368+
# name="vert: bool",
4369+
# alternative="orientation: {'vertical', 'horizontal'}",
4370+
# pending=True,
4371+
# )
43684372
if vert is False:
43694373
orientation = 'horizontal'
43704374
_api.check_in_list(['horizontal', 'vertical'], orientation=orientation)
@@ -8641,11 +8645,14 @@ def violin(self, vpstats, positions=None, vert=None,
86418645
# deprecation period expires. If both are selected,
86428646
# vert takes precedence.
86438647
if vert is not None:
8644-
_api.warn_deprecated(
8645-
"3.10",
8646-
name="vert: bool",
8647-
alternative="orientation: {'vertical', 'horizontal'}"
8648-
)
8648+
# Deprecation warning delayed as the new api was introduced in 3.10
8649+
#
8650+
# _api.warn_deprecated(
8651+
# "3.11",
8652+
# name="vert: bool",
8653+
# alternative="orientation: {'vertical', 'horizontal'}",
8654+
# pending=True,
8655+
# )
86498656
orientation = 'vertical' if vert else 'horizontal'
86508657
_api.check_in_list(['horizontal', 'vertical'], orientation=orientation)
86518658

0 commit comments

Comments
 (0)