Skip to content

Commit

Permalink
Remove deprecated arguments and keyword arguments.
Browse files Browse the repository at this point in the history
  • Loading branch information
QuLogic committed Apr 25, 2020
1 parent 283d322 commit ec8dbab
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 25 deletions.
11 changes: 8 additions & 3 deletions doc/api/api_changes_3.3/removals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ Arguments
- The unused parameter ``interp_at_native`` of `.BboxImage` has been removed.
- The parameter ``usetex`` of `.TextToPath.get_text_path` has been removed.
Use ``ismath='TeX'`` instead.
- The parameter ``block`` of ``show()`` is now keyword-only.
- The parameter ``block`` of ``show()`` is now keyword-only, and arbitrary
arguments or keyword arguments are no longer accepted.
- The parameter ``frameon`` of `.Figure.savefig` has been removed. Use
``facecolor="none"`` to get a transparent background.
- Passing a ``wx.EvtHandler`` as the first argument to ``backend_wx.TimerWx``
Expand All @@ -195,10 +196,14 @@ Arguments
other than ``ticklabels``.
- ``mpl_toolkits.mplot3d.art3d.Poly3DCollection.set_zsort`` does not accept
the value ``True`` anymore. Pass the equivalent value 'average' instead.
- `~.ConnectionPatch` no longer accepts the ``arrow_transmuter`` and
- `.AnchoredText` no longer accepts ``horizontalalignment`` or
``verticalalignment`` keyword arguments.
- `.ConnectionPatch` no longer accepts the ``arrow_transmuter`` and
``connector`` keyword arguments, which did nothing since 3.0.
- `~.FancyArrowPatch` no longer accepts the ``arrow_transmuter`` and
- `.FancyArrowPatch` no longer accepts the ``arrow_transmuter`` and
``connector`` keyword arguments, which did nothing since 3.0.
- `.TextPath` no longer accepts arbitrary positional or keyword arguments.
- `.MaxNLocator.set_params()` no longer accepts arbitrary keyword arguments.

rcParams
~~~~~~~~
Expand Down
8 changes: 1 addition & 7 deletions lib/matplotlib/backends/backend_nbagg.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,7 @@ def trigger_manager_draw(manager):
manager.show()

@staticmethod
def show(*args, block=None, **kwargs):
if args or kwargs:
cbook.warn_deprecated(
"3.1", message="Passing arguments to show(), other than "
"passing 'block' by keyword, is deprecated %(since)s, and "
"support for it will be removed %(removal)s.")

def show(block=None):
## TODO: something to do when keyword block==False ?
from matplotlib._pylab_helpers import Gcf

Expand Down
8 changes: 3 additions & 5 deletions lib/matplotlib/offsetbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -1285,11 +1285,9 @@ def __init__(self, s, loc, pad=0.4, borderpad=0.5, prop=None, **kwargs):
prop = {}
badkwargs = {'ha', 'horizontalalignment', 'va', 'verticalalignment'}
if badkwargs & set(prop):
cbook.warn_deprecated(
"3.1", message="Mixing horizontalalignment or "
"verticalalignment with AnchoredText is not supported, "
"deprecated since %(since)s, and will raise an exception "
"%(removal)s.")
raise ValueError(
"Mixing horizontalalignment or verticalalignment with "
"AnchoredText is not supported.")

self.txt = TextArea(s, textprops=prop, minimumdescent=False)
fp = self.txt._text.get_fontproperties()
Expand Down
8 changes: 1 addition & 7 deletions lib/matplotlib/textpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,7 @@ class TextPath(Path):
"""

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

if args or kwargs:
cbook.warn_deprecated(
"3.1", message="Additional arguments to TextPath used to be "
"ignored, but will trigger a TypeError %(removal)s.")

if prop is None:
prop = FontProperties()
else:
Expand Down
5 changes: 2 additions & 3 deletions lib/matplotlib/ticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2095,9 +2095,8 @@ def set_params(self, **kwargs):
self._integer = kwargs.pop('integer')
if kwargs:
key, _ = kwargs.popitem()
cbook.warn_deprecated("3.1",
message="MaxNLocator.set_params got an "
f"unexpected parameter: {key}")
raise TypeError(
f"set_params() got an unexpected keyword argument '{key}'")

def _raw_ticks(self, vmin, vmax):
"""
Expand Down

0 comments on commit ec8dbab

Please sign in to comment.