From 26b6241edacf671912667f32b9d4c60bb5162e82 Mon Sep 17 00:00:00 2001 From: Krrish Verma Date: Sat, 14 Oct 2023 20:16:54 +0530 Subject: [PATCH 1/3] removed the deprecated API from lib/matplotlib/gridspec.py --- lib/matplotlib/gridspec.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/matplotlib/gridspec.py b/lib/matplotlib/gridspec.py index 0b93ea93dd3d..6e628cc8ab14 100644 --- a/lib/matplotlib/gridspec.py +++ b/lib/matplotlib/gridspec.py @@ -17,7 +17,7 @@ import numpy as np import matplotlib as mpl -from matplotlib import _api, _pylab_helpers, _tight_layout +from matplotlib import _pylab_helpers, _tight_layout from matplotlib.transforms import Bbox _log = logging.getLogger(__name__) @@ -265,8 +265,6 @@ def subplots(self, *, sharex=False, sharey=False, squeeze=True, if not isinstance(sharey, str): sharey = "all" if sharey else "none" - _api.check_in_list(["all", "row", "col", "none", False, True], - sharex=sharex, sharey=sharey) if subplot_kw is None: subplot_kw = {} # don't mutate kwargs passed by user... @@ -567,8 +565,6 @@ def _from_subplot_args(figure, args): f"integer, not {arg!r}") from None elif len(args) == 3: rows, cols, num = args - else: - raise _api.nargs_error("subplot", takes="1 or 3", given=len(args)) gs = GridSpec._check_gridspec_exists(figure, rows, cols) if gs is None: From 226726ba873f999f8b4834ce4f9138c57f43fd9a Mon Sep 17 00:00:00 2001 From: Krrish Verma Date: Sat, 14 Oct 2023 20:23:32 +0530 Subject: [PATCH 2/3] This PR removes the deprecated code during the version 3.7 from lib/matplotlib/gridspec.py and lib/matplotlib/_fontconfig_patterns.py --- lib/matplotlib/_fontconfig_pattern.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib/matplotlib/_fontconfig_pattern.py b/lib/matplotlib/_fontconfig_pattern.py index d3933b9f396d..d8806c24c4c5 100644 --- a/lib/matplotlib/_fontconfig_pattern.py +++ b/lib/matplotlib/_fontconfig_pattern.py @@ -15,8 +15,6 @@ from pyparsing import ( Group, Optional, ParseException, Regex, StringEnd, Suppress, ZeroOrMore) -from matplotlib import _api - _family_punc = r'\\\-:,' _family_unescape = partial(re.compile(r'\\(?=[%s])' % _family_punc).sub, '') @@ -97,12 +95,6 @@ def parse_fontconfig_pattern(pattern): props["size"] = [*parse["sizes"]] for prop in parse.get("properties", []): if len(prop) == 1: - if prop[0] not in _CONSTANTS: - _api.warn_deprecated( - "3.7", message=f"Support for unknown constants " - f"({prop[0]!r}) is deprecated since %(since)s and " - f"will be removed %(removal)s.") - continue prop = _CONSTANTS[prop[0]] k, *v = prop props.setdefault(k, []).extend(map(_value_unescape, v)) From 19dcdcbf9314c899da91d631cea825f7bec35e28 Mon Sep 17 00:00:00 2001 From: Krrish Verma Date: Sat, 14 Oct 2023 20:28:28 +0530 Subject: [PATCH 3/3] This PR removes the deprecated code during the version 3.7 from lib/matplotlib/gridspec.py and lib/matplotlib/_fontconfig_patterns.py --- lib/matplotlib/gridspec.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/matplotlib/gridspec.py b/lib/matplotlib/gridspec.py index 6e628cc8ab14..bf9d8a772fa5 100644 --- a/lib/matplotlib/gridspec.py +++ b/lib/matplotlib/gridspec.py @@ -265,6 +265,7 @@ def subplots(self, *, sharex=False, sharey=False, squeeze=True, if not isinstance(sharey, str): sharey = "all" if sharey else "none" + if subplot_kw is None: subplot_kw = {} # don't mutate kwargs passed by user... @@ -565,6 +566,8 @@ def _from_subplot_args(figure, args): f"integer, not {arg!r}") from None elif len(args) == 3: rows, cols, num = args + else: + continue gs = GridSpec._check_gridspec_exists(figure, rows, cols) if gs is None: