From f527efdd8d076be28170a1bb8e36d25ef28b9035 Mon Sep 17 00:00:00 2001 From: Jody Klymak Date: Fri, 19 Apr 2019 21:20:36 -0700 Subject: [PATCH 1/3] FIX: undeprecate MaxNLocator default_params --- lib/matplotlib/ticker.py | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/lib/matplotlib/ticker.py b/lib/matplotlib/ticker.py index 7716cff39ff4..209a3f92ce6b 100644 --- a/lib/matplotlib/ticker.py +++ b/lib/matplotlib/ticker.py @@ -1883,12 +1883,12 @@ class MaxNLocator(Locator): """ Select no more than N intervals at nice locations. """ - _default_params = dict(nbins=10, - steps=None, - integer=False, - symmetric=False, - prune=None, - min_n_ticks=2) + default_params = dict(nbins=10, + steps=None, + integer=False, + symmetric=False, + prune=None, + min_n_ticks=2) def __init__(self, *args, **kwargs): """ @@ -1940,7 +1940,7 @@ def __init__(self, *args, **kwargs): if len(args) > 1: raise ValueError( "Keywords are required for all arguments except 'nbins'") - self.set_params(**{**self._default_params, **kwargs}) + self.set_params(**{**self.default_params, **kwargs}) @staticmethod def _validate_steps(steps): @@ -1957,16 +1957,6 @@ def _validate_steps(steps): steps = np.hstack((steps, 10)) return steps - @cbook.deprecated("3.1") - @property - def default_params(self): - return self._default_params - - @cbook.deprecated("3.1") - @default_params.setter - def default_params(self, params): - self._default_params = params - @staticmethod def _staircase(steps): # Make an extended staircase within which the needed From ffd8d6a2b09372df1d1c933db1710ff97fecf85d Mon Sep 17 00:00:00 2001 From: Jody Klymak Date: Sat, 20 Apr 2019 13:37:36 -0700 Subject: [PATCH 2/3] DOC: remove deprcation note --- doc/api/prev_api_changes/api_changes_3.1.0.rst | 7 ------- 1 file changed, 7 deletions(-) diff --git a/doc/api/prev_api_changes/api_changes_3.1.0.rst b/doc/api/prev_api_changes/api_changes_3.1.0.rst index 94d078c9b49a..a90b8cef64ba 100644 --- a/doc/api/prev_api_changes/api_changes_3.1.0.rst +++ b/doc/api/prev_api_changes/api_changes_3.1.0.rst @@ -750,9 +750,6 @@ The following signature related behaviours are deprecated: - Passing ``shade=None`` to `~.axes3d.Axes3D.plot_surface` is deprecated. This was an unintended implementation detail with the same semantics as ``shade=False``. Please use the latter code instead. -- `matplotlib.ticker.MaxNLocator` and its *set_params* method will issue - a warning on unknown keyword arguments instead of silently ignoring them. - Future versions will raise an error. Changes in parameter names -------------------------- @@ -938,10 +935,6 @@ classes, whose constructors take a *base* argument. Locators / Formatters ~~~~~~~~~~~~~~~~~~~~~ -- `matplotlib.ticker.MaxNLocator.default_params` class variable - -The defaults are not supposed to be user-configurable. - - ``OldScalarFormatter.pprint_val`` - ``ScalarFormatter.pprint_val`` - ``LogFormatter.pprint_val`` From 50a1808393035229c77e8c38943e5415e38d26b8 Mon Sep 17 00:00:00 2001 From: Jody Klymak Date: Sat, 20 Apr 2019 13:49:20 -0700 Subject: [PATCH 3/3] DOC: remove deprcation note --- doc/api/prev_api_changes/api_changes_3.1.0.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/api/prev_api_changes/api_changes_3.1.0.rst b/doc/api/prev_api_changes/api_changes_3.1.0.rst index a90b8cef64ba..60ec3439dcd3 100644 --- a/doc/api/prev_api_changes/api_changes_3.1.0.rst +++ b/doc/api/prev_api_changes/api_changes_3.1.0.rst @@ -750,6 +750,9 @@ The following signature related behaviours are deprecated: - Passing ``shade=None`` to `~.axes3d.Axes3D.plot_surface` is deprecated. This was an unintended implementation detail with the same semantics as ``shade=False``. Please use the latter code instead. +- `matplotlib.ticker.MaxNLocator` and its *set_params* method will issue + a warning on unknown keyword arguments instead of silently ignoring them. + Future versions will raise an error. Changes in parameter names --------------------------