Skip to content

Remove remaining 3.3 deprecations #20465

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions doc/api/animation_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ on all systems.

FFMpegWriter
ImageMagickWriter
AVConvWriter

The file-based writers save temporary files for each frame which are stitched
into a single file at the end. Although slower, these writers can be easier to
Expand All @@ -198,7 +197,6 @@ debug.

FFMpegFileWriter
ImageMagickFileWriter
AVConvFileWriter

Fundamentally, a `MovieWriter` provides a way to grab sequential frames
from the same underlying `~matplotlib.figure.Figure` object. The base
Expand Down Expand Up @@ -283,7 +281,6 @@ and mixins
:toctree: _as_gen
:nosignatures:

AVConvBase
FFMpegBase
ImageMagickBase

Expand All @@ -298,6 +295,6 @@ Inheritance Diagrams
:private-bases:
:parts: 1

.. inheritance-diagram:: matplotlib.animation.AVConvFileWriter matplotlib.animation.AVConvWriter matplotlib.animation.FFMpegFileWriter matplotlib.animation.FFMpegWriter matplotlib.animation.ImageMagickFileWriter matplotlib.animation.ImageMagickWriter
.. inheritance-diagram:: matplotlib.animation.FFMpegFileWriter matplotlib.animation.FFMpegWriter matplotlib.animation.ImageMagickFileWriter matplotlib.animation.ImageMagickWriter
:private-bases:
:parts: 1
2 changes: 0 additions & 2 deletions doc/api/artist_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ Interactive
Artist.format_cursor_data
Artist.mouseover
Artist.contains
Artist.set_contains
Artist.get_contains
Artist.pick
Artist.pickable
Artist.set_picker
Expand Down
93 changes: 93 additions & 0 deletions doc/api/next_api_changes/removals/20465-ES.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
Case-insensitive properties
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Upper or mixed-case property names are no longer normalized to lowercase in
`.Artist.set` and `.Artist.update`. This allows one to pass names such as
*patchA* or *UVC*.

Case-insensitive capstyles and joinstyles
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please pass capstyles ("miter", "round", "bevel") and joinstyles ("butt",
"round", "projecting") as lowercase.

AVConv animation writers removed
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The ``AVConvBase``, ``AVConvWriter`` and ``AVConvFileWriter`` classes, and the
associated ``animation.avconv_path`` and ``animation.avconv_args`` rcParams
have been removed.

Debian 8 (2015, EOL 06/2020) and Ubuntu 14.04 (EOL 04/2019) were the
last versions of Debian and Ubuntu to ship avconv. It remains possible
to force the use of avconv by using the FFmpeg-based writers with
:rc:`animation.ffmpeg_path` set to "avconv".

``MovieWriter`` attributes
~~~~~~~~~~~~~~~~~~~~~~~~~~
* ``animation.html_args`` rcParam
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* ``animation.html_args`` rcParam
* The rcParam ``animation.html_args`` has been removed.

IMHO for clarity, we should take the effort and make full sentences. Also in the following bullet points.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit lazier here because a) this is in the removal section, so it's implied, and b) I re-edit these when I put together final release notes and they may or may not be re-grouped, and then will get an overall sentence then.

* ``HTMLWriter.args_key`` attribute
* ``MovieWriter.args_key`` and ``MovieWriter.exec_key`` attributes
* *clear_temp* parameter and attribute of `.FileMovieWriter`; files placed in a
temporary directory (using ``frame_prefix=None``, the default) will be
cleared; files placed elsewhere will not.

Artist-specific removals
~~~~~~~~~~~~~~~~~~~~~~~~
* Setting a custom method overriding `.Artist.contains` using
``Artist.set_contains`` has been removed, as has ``Artist.get_contains``.
There is no replacement, but you may still customize pick events using
`.Artist.set_picker`.
* Passing the dash offset as ``None`` is no longer accepted, as this was never
universally implemented, e.g. for vector output. Set the offset to 0 instead.
* The parameter *props* of `.Shadow` has been removed. Use keyword arguments
instead.
* Arbitrary keyword arguments to ``StreamplotSet`` have no effect and have been
removed.
* ``NonUniformImage.is_grayscale`` and ``PcolorImage.is_grayscale`` attributes
have been removed, for consistency with ``AxesImage.is_grayscale``. (Note
that previously, these attributes were only available *after rendering the
image*).

Path helpers
~~~~~~~~~~~~
* ``bezier.make_path_regular``; use ``Path.cleaned()`` (or
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* ``bezier.make_path_regular``; use ``Path.cleaned()`` (or
* ``bezier.make_path_regular`` has been removed. Use ``Path.cleaned()`` (or

``Path.cleaned(curves=True)``, etc.) instead, but note that these methods add
a ``STOP`` code at the end of the path.
* ``bezier.concatenate_paths``; use ``Path.make_compound_path()`` instead.
* *quantize* parameter of `.Path.cleaned()`

``BboxBase.inverse_transformed``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

``.BboxBase.inverse_transformed`` has been removed (call `.BboxBase.transformed`
on the `~.Transform.inverted()` transform instead).

``matplotlib.test(recursionlimit=...)``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The *recursionlimit* parameter of `matplotlib.test` has been removed.

``testing.compare.make_external_conversion_command``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
... has been removed.

``docstring.Substitution.from_params``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This method has been removed. If needed, directly assign to the ``params``
attribute of the Substitution object.

``widgets.TextBox.params_to_disable``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This attribute has been removed.

`.widgets.SubplotTool` callbacks and axes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The ``funcleft``, ``funcright``, ``funcbottom``, ``functop``, ``funcwspace``,
and ``funchspace`` methods of `.widgets.SubplotTool` have been removed.

The ``axleft``, ``axright``, ``axbottom``, ``axtop``, ``axwspace``, and
``axhspace`` attributes of `.widgets.SubplotTool` have been removed. Access
the ``ax`` attribute of the corresponding slider, if needed.

Variants on ``ToolManager.update_keymap`` calls
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Passing multiple keys as a single comma-separated string or multiple arguments
to `.ToolManager.update_keymap` is no longer supported; pass keys as a list of
strings instead.
4 changes: 2 additions & 2 deletions doc/api/prev_api_changes/api_changes_0.98.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ with a verb in the present tense.
| ``lbwh_to_bbox(l, b, w, h)`` | `Bbox.from_bounds(x0, y0, w, h) <.Bbox.from_bounds>` |
| | [It is a staticmethod.] |
+--------------------------------------------+------------------------------------------------------+
| ``inverse_transform_bbox(trans, bbox)`` | `Bbox.inverse_transformed(trans) |
| | <.BboxBase.inverse_transformed>` |
| ``inverse_transform_bbox(trans, bbox)`` | ``bbox.inverse_transformed(trans)`` |
| | |
+--------------------------------------------+------------------------------------------------------+
| ``Interval.contains_open(v)`` | `interval_contains_open(tuple, v) |
| | <.interval_contains_open>` |
Expand Down
7 changes: 1 addition & 6 deletions lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1174,8 +1174,7 @@ def _init_tests():
"" if ft2font.__freetype_build_type__ == 'local' else "not "))


@_api.delete_parameter("3.3", "recursionlimit")
def test(verbosity=None, coverage=False, *, recursionlimit=0, **kwargs):
def test(verbosity=None, coverage=False, **kwargs):
"""Run the matplotlib test suite."""

try:
Expand All @@ -1192,8 +1191,6 @@ def test(verbosity=None, coverage=False, *, recursionlimit=0, **kwargs):
old_recursionlimit = sys.getrecursionlimit()
try:
use('agg')
if recursionlimit:
sys.setrecursionlimit(recursionlimit)

args = kwargs.pop('argv', [])
provide_default_modules = True
Expand Down Expand Up @@ -1222,8 +1219,6 @@ def test(verbosity=None, coverage=False, *, recursionlimit=0, **kwargs):
finally:
if old_backend.lower() != 'agg':
use(old_backend)
if recursionlimit:
sys.setrecursionlimit(old_recursionlimit)

return retcode

Expand Down
27 changes: 1 addition & 26 deletions lib/matplotlib/_enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"""

from enum import Enum, auto
from matplotlib import cbook, docstring
from matplotlib import docstring


class _AutoStringNameEnum(Enum):
Expand All @@ -24,23 +24,6 @@ def __hash__(self):
return str(self).__hash__()


def _deprecate_case_insensitive_join_cap(s):
s_low = s.lower()
if s != s_low:
if s_low in ['miter', 'round', 'bevel']:
cbook.warn_deprecated(
"3.3", message="Case-insensitive capstyles are deprecated "
"since %(since)s and support for them will be removed "
"%(removal)s; please pass them in lowercase.")
elif s_low in ['butt', 'round', 'projecting']:
cbook.warn_deprecated(
"3.3", message="Case-insensitive joinstyles are deprecated "
"since %(since)s and support for them will be removed "
"%(removal)s; please pass them in lowercase.")
# Else, error out at the check_in_list stage.
return s_low


class JoinStyle(str, _AutoStringNameEnum):
"""
Define how the connection between two line segments is drawn.
Expand Down Expand Up @@ -100,10 +83,6 @@ class JoinStyle(str, _AutoStringNameEnum):
round = auto()
bevel = auto()

def __init__(self, s):
s = _deprecate_case_insensitive_join_cap(s)
Enum.__init__(self)

@staticmethod
def demo():
"""Demonstrate how each JoinStyle looks for various join angles."""
Expand Down Expand Up @@ -173,10 +152,6 @@ class CapStyle(str, _AutoStringNameEnum):
projecting = 'projecting'
round = 'round'

def __init__(self, s):
s = _deprecate_case_insensitive_join_cap(s)
Enum.__init__(self)

@staticmethod
def demo():
"""Demonstrate how each CapStyle looks for a thick line segment."""
Expand Down
Loading