Skip to content

Commit

Permalink
Merge pull request #22486 from oscargus/patchdeprecations
Browse files Browse the repository at this point in the history
Expire deprecations in lines and patches
  • Loading branch information
timhoffm committed Feb 20, 2022
2 parents 8747d14 + 8466d11 commit b80bc91
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 58 deletions.
7 changes: 7 additions & 0 deletions doc/api/next_api_changes/removals/22486-OG.rst
@@ -0,0 +1,7 @@
Removal of deprecated methods and properties in ``lines`` and ``patches``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The deperecated properties ``validCap`` and ``validJoin`` have been removed
from `~.Line2D` and `~.Patch` as the validation is centralized in ``rcsetup``.
The deprecated methods ``get_dpi_cor`` and ``set_dpi_cor`` have been removed
from `~.FancyArrowPatch` as the parameter ``dpi_cor`` is removed.
10 changes: 0 additions & 10 deletions lib/matplotlib/lines.py
Expand Up @@ -252,16 +252,6 @@ class Line2D(Artist):

zorder = 2

@_api.deprecated("3.4")
@_api.classproperty
def validCap(cls):
return tuple(cs.value for cs in CapStyle)

@_api.deprecated("3.4")
@_api.classproperty
def validJoin(cls):
return tuple(js.value for js in JoinStyle)

def __str__(self):
if self._label != "":
return f"Line2D({self._label})"
Expand Down
49 changes: 1 addition & 48 deletions lib/matplotlib/patches.py
Expand Up @@ -40,18 +40,6 @@ class Patch(artist.Artist):
"""
zorder = 1

@_api.deprecated("3.4")
@_api.classproperty
def validCap(cls):
with _api.suppress_matplotlib_deprecation_warning():
return mlines.Line2D.validCap

@_api.deprecated("3.4")
@_api.classproperty
def validJoin(cls):
with _api.suppress_matplotlib_deprecation_warning():
return mlines.Line2D.validJoin

# Whether to draw an edge by default. Set on a
# subclass-by-subclass basis.
_edge_default = False
Expand Down Expand Up @@ -4229,13 +4217,11 @@ def __str__(self):
return f"{type(self).__name__}({self._path_original})"

@docstring.dedent_interpd
@_api.delete_parameter("3.4", "dpi_cor")
def __init__(self, posA=None, posB=None, path=None,
arrowstyle="simple", connectionstyle="arc3",
patchA=None, patchB=None,
shrinkA=2, shrinkB=2,
mutation_scale=1, mutation_aspect=1,
dpi_cor=1,
**kwargs):
"""
There are two ways for defining an arrow:
Expand Down Expand Up @@ -4291,10 +4277,6 @@ def __init__(self, posA=None, posB=None, path=None,
the mutation and the mutated box will be stretched by the inverse
of it.
dpi_cor : float, default: 1
dpi_cor is currently used for linewidth-related things and shrink
factor. Mutation scale is affected by this. Deprecated.
Other Parameters
----------------
**kwargs : `.Patch` properties, optional
Expand Down Expand Up @@ -4335,32 +4317,7 @@ def __init__(self, posA=None, posB=None, path=None,
self._mutation_scale = mutation_scale
self._mutation_aspect = mutation_aspect

self._dpi_cor = dpi_cor

@_api.deprecated("3.4")
def set_dpi_cor(self, dpi_cor):
"""
dpi_cor is currently used for linewidth-related things and
shrink factor. Mutation scale is affected by this.
Parameters
----------
dpi_cor : float
"""
self._dpi_cor = dpi_cor
self.stale = True

@_api.deprecated("3.4")
def get_dpi_cor(self):
"""
dpi_cor is currently used for linewidth-related things and
shrink factor. Mutation scale is affected by this.
Returns
-------
scalar
"""
return self._dpi_cor
self._dpi_cor = 1.0

def set_positions(self, posA, posB):
"""
Expand Down Expand Up @@ -4575,7 +4532,6 @@ def __str__(self):
(self.xy1[0], self.xy1[1], self.xy2[0], self.xy2[1])

@docstring.dedent_interpd
@_api.delete_parameter("3.4", "dpi_cor")
def __init__(self, xyA, xyB, coordsA, coordsB=None,
axesA=None, axesB=None,
arrowstyle="-",
Expand All @@ -4587,7 +4543,6 @@ def __init__(self, xyA, xyB, coordsA, coordsB=None,
mutation_scale=10.,
mutation_aspect=None,
clip_on=False,
dpi_cor=1.,
**kwargs):
"""
Connect point *xyA* in *coordsA* with point *xyB* in *coordsB*.
Expand Down Expand Up @@ -4677,8 +4632,6 @@ def __init__(self, xyA, xyB, coordsA, coordsB=None,
mutation_aspect=mutation_aspect,
clip_on=clip_on,
**kwargs)
self._dpi_cor = dpi_cor

# if True, draw annotation only if self.xy is inside the axes
self._annotation_clip = None

Expand Down

0 comments on commit b80bc91

Please sign in to comment.