From 41ee6b28c65efec1b88b3d0666ddb1945d2b4b2b Mon Sep 17 00:00:00 2001 From: Kyle Sunden Date: Mon, 18 Nov 2024 17:16:45 -0600 Subject: [PATCH] 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. --- lib/matplotlib/axes/_axes.py | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index f6a4ebfdc7c6..bee72d74add0 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -4360,11 +4360,15 @@ def merge_kw_rc(subkey, explicit, zdelta=0, usemarker=True): if vert is None: vert = mpl.rcParams['boxplot.vertical'] else: - _api.warn_deprecated( - "3.10", - name="vert: bool", - alternative="orientation: {'vertical', 'horizontal'}" - ) + pass + # Deprecation warning delayed as the alternative was only introduced in 3.10 + # + # _api.warn_deprecated( + # "3.11", + # name="vert: bool", + # alternative="orientation: {'vertical', 'horizontal'}", + # pending=True, + # ) if vert is False: orientation = 'horizontal' _api.check_in_list(['horizontal', 'vertical'], orientation=orientation) @@ -8641,11 +8645,14 @@ def violin(self, vpstats, positions=None, vert=None, # deprecation period expires. If both are selected, # vert takes precedence. if vert is not None: - _api.warn_deprecated( - "3.10", - name="vert: bool", - alternative="orientation: {'vertical', 'horizontal'}" - ) + # Deprecation warning delayed as the new api was introduced in 3.10 + # + # _api.warn_deprecated( + # "3.11", + # name="vert: bool", + # alternative="orientation: {'vertical', 'horizontal'}", + # pending=True, + # ) orientation = 'vertical' if vert else 'horizontal' _api.check_in_list(['horizontal', 'vertical'], orientation=orientation)