Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 535f7f4

Browse files
committed
MNT: deprecate unused numdecs LogLocator param
1 parent e8101f1 commit 535f7f4

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*numdecs* parameter of ``LogLocator``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
... is deprecated without replacement, because it had no effect.

lib/matplotlib/tests/test_ticker.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import matplotlib as mpl
1212
import matplotlib.pyplot as plt
1313
import matplotlib.ticker as mticker
14+
from matplotlib._api import MatplotlibDeprecationWarning
1415

1516

1617
class TestMaxNLocator:
@@ -233,7 +234,8 @@ def test_set_params(self):
233234
See if change was successful. Should not raise exception.
234235
"""
235236
loc = mticker.LogLocator()
236-
loc.set_params(numticks=7, numdecs=8, subs=[2.0], base=4)
237+
with pytest.warns(MatplotlibDeprecationWarning, match="numdecs"):
238+
loc.set_params(numticks=7, numdecs=8, subs=[2.0], base=4)
237239
assert loc.numticks == 7
238240
assert loc.numdecs == 8
239241
assert loc._base == 4

lib/matplotlib/ticker.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2244,6 +2244,7 @@ class LogLocator(Locator):
22442244
22452245
"""
22462246

2247+
@_api.delete_parameter("3.8", "numdecs")
22472248
def __init__(self, base=10.0, subs=(1.0,), numdecs=4, numticks=None):
22482249
"""Place ticks on the locations : subs[j] * base**i."""
22492250
if numticks is None:
@@ -2256,6 +2257,7 @@ def __init__(self, base=10.0, subs=(1.0,), numdecs=4, numticks=None):
22562257
self.numdecs = numdecs
22572258
self.numticks = numticks
22582259

2260+
@_api.delete_parameter("3.8", "numdecs")
22592261
def set_params(self, base=None, subs=None, numdecs=None, numticks=None):
22602262
"""Set parameters within this locator."""
22612263
if base is not None:

0 commit comments

Comments
 (0)