From d3457e2ea230a8f59905183522f586b5b9784cf7 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Mon, 5 Aug 2024 15:48:06 -0400 Subject: [PATCH 1/2] API: deprecate unused helper in patch._Styles --- doc/api/next_api_changes/deprecations/28670-TAC.rst | 6 ++++++ lib/matplotlib/patches.py | 5 +++++ 2 files changed, 11 insertions(+) create mode 100644 doc/api/next_api_changes/deprecations/28670-TAC.rst diff --git a/doc/api/next_api_changes/deprecations/28670-TAC.rst b/doc/api/next_api_changes/deprecations/28670-TAC.rst new file mode 100644 index 000000000000..50ada7201437 --- /dev/null +++ b/doc/api/next_api_changes/deprecations/28670-TAC.rst @@ -0,0 +1,6 @@ +Drerecated ``matplotlib.patches._Styles`` and subclasses +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This class method is never used internally. Due to the internal check in the +method it only accepts subclasses of a private baseclass embedded in the host +class which makes it unlikely that it has been used externally. diff --git a/lib/matplotlib/patches.py b/lib/matplotlib/patches.py index 2899952634a9..bc75e6923879 100644 --- a/lib/matplotlib/patches.py +++ b/lib/matplotlib/patches.py @@ -2347,6 +2347,11 @@ def pprint_styles(cls): return textwrap.indent(rst_table, prefix=' ' * 4) @classmethod + @_api.deprecated( + '3.10.0', + message="This method is never used internally.", + alternative="No replacement. Please open an issue if you use this." + ) def register(cls, name, style): """Register a new style.""" if not issubclass(style, cls._Base): From cde1fa5c3045d446b0d9e5cf46e350589fb73655 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Tue, 6 Aug 2024 14:34:47 -0400 Subject: [PATCH 2/2] DOC: correct heading Co-authored-by: Kyle Sunden --- doc/api/next_api_changes/deprecations/28670-TAC.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/next_api_changes/deprecations/28670-TAC.rst b/doc/api/next_api_changes/deprecations/28670-TAC.rst index 50ada7201437..e970abf69d54 100644 --- a/doc/api/next_api_changes/deprecations/28670-TAC.rst +++ b/doc/api/next_api_changes/deprecations/28670-TAC.rst @@ -1,5 +1,5 @@ -Drerecated ``matplotlib.patches._Styles`` and subclasses -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Deprecated ``register`` on ``matplotlib.patches._Styles`` and subclasses +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This class method is never used internally. Due to the internal check in the method it only accepts subclasses of a private baseclass embedded in the host