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

Skip to content

Commit ec8dbab

Browse files
committed
Remove deprecated arguments and keyword arguments.
1 parent 283d322 commit ec8dbab

File tree

5 files changed

+15
-25
lines changed

5 files changed

+15
-25
lines changed

doc/api/api_changes_3.3/removals.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ Arguments
176176
- The unused parameter ``interp_at_native`` of `.BboxImage` has been removed.
177177
- The parameter ``usetex`` of `.TextToPath.get_text_path` has been removed.
178178
Use ``ismath='TeX'`` instead.
179-
- The parameter ``block`` of ``show()`` is now keyword-only.
179+
- The parameter ``block`` of ``show()`` is now keyword-only, and arbitrary
180+
arguments or keyword arguments are no longer accepted.
180181
- The parameter ``frameon`` of `.Figure.savefig` has been removed. Use
181182
``facecolor="none"`` to get a transparent background.
182183
- Passing a ``wx.EvtHandler`` as the first argument to ``backend_wx.TimerWx``
@@ -195,10 +196,14 @@ Arguments
195196
other than ``ticklabels``.
196197
- ``mpl_toolkits.mplot3d.art3d.Poly3DCollection.set_zsort`` does not accept
197198
the value ``True`` anymore. Pass the equivalent value 'average' instead.
198-
- `~.ConnectionPatch` no longer accepts the ``arrow_transmuter`` and
199+
- `.AnchoredText` no longer accepts ``horizontalalignment`` or
200+
``verticalalignment`` keyword arguments.
201+
- `.ConnectionPatch` no longer accepts the ``arrow_transmuter`` and
199202
``connector`` keyword arguments, which did nothing since 3.0.
200-
- `~.FancyArrowPatch` no longer accepts the ``arrow_transmuter`` and
203+
- `.FancyArrowPatch` no longer accepts the ``arrow_transmuter`` and
201204
``connector`` keyword arguments, which did nothing since 3.0.
205+
- `.TextPath` no longer accepts arbitrary positional or keyword arguments.
206+
- `.MaxNLocator.set_params()` no longer accepts arbitrary keyword arguments.
202207

203208
rcParams
204209
~~~~~~~~

lib/matplotlib/backends/backend_nbagg.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -239,13 +239,7 @@ def trigger_manager_draw(manager):
239239
manager.show()
240240

241241
@staticmethod
242-
def show(*args, block=None, **kwargs):
243-
if args or kwargs:
244-
cbook.warn_deprecated(
245-
"3.1", message="Passing arguments to show(), other than "
246-
"passing 'block' by keyword, is deprecated %(since)s, and "
247-
"support for it will be removed %(removal)s.")
248-
242+
def show(block=None):
249243
## TODO: something to do when keyword block==False ?
250244
from matplotlib._pylab_helpers import Gcf
251245

lib/matplotlib/offsetbox.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,11 +1285,9 @@ def __init__(self, s, loc, pad=0.4, borderpad=0.5, prop=None, **kwargs):
12851285
prop = {}
12861286
badkwargs = {'ha', 'horizontalalignment', 'va', 'verticalalignment'}
12871287
if badkwargs & set(prop):
1288-
cbook.warn_deprecated(
1289-
"3.1", message="Mixing horizontalalignment or "
1290-
"verticalalignment with AnchoredText is not supported, "
1291-
"deprecated since %(since)s, and will raise an exception "
1292-
"%(removal)s.")
1288+
raise ValueError(
1289+
"Mixing horizontalalignment or verticalalignment with "
1290+
"AnchoredText is not supported.")
12931291

12941292
self.txt = TextArea(s, textprops=prop, minimumdescent=False)
12951293
fp = self.txt._text.get_fontproperties()

lib/matplotlib/textpath.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,7 @@ class TextPath(Path):
349349
"""
350350

351351
def __init__(self, xy, s, size=None, prop=None,
352-
_interpolation_steps=1, usetex=False,
353-
*args, **kwargs):
352+
_interpolation_steps=1, usetex=False):
354353
r"""
355354
Create a path from the text. Note that it simply is a path,
356355
not an artist. You need to use the `~.PathPatch` (or other artists)
@@ -396,11 +395,6 @@ def __init__(self, xy, s, size=None, prop=None,
396395
# Circular import.
397396
from matplotlib.text import Text
398397

399-
if args or kwargs:
400-
cbook.warn_deprecated(
401-
"3.1", message="Additional arguments to TextPath used to be "
402-
"ignored, but will trigger a TypeError %(removal)s.")
403-
404398
if prop is None:
405399
prop = FontProperties()
406400
else:

lib/matplotlib/ticker.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2095,9 +2095,8 @@ def set_params(self, **kwargs):
20952095
self._integer = kwargs.pop('integer')
20962096
if kwargs:
20972097
key, _ = kwargs.popitem()
2098-
cbook.warn_deprecated("3.1",
2099-
message="MaxNLocator.set_params got an "
2100-
f"unexpected parameter: {key}")
2098+
raise TypeError(
2099+
f"set_params() got an unexpected keyword argument '{key}'")
21012100

21022101
def _raw_ticks(self, vmin, vmax):
21032102
"""

0 commit comments

Comments
 (0)