Skip to content

Commit 438aa08

Browse files
authored
Merge pull request #10608 from anntzer/remove-deprecated21
Remove most APIs deprecated in 2.1.
2 parents 65ddd82 + cc48afd commit 438aa08

24 files changed

+35
-964
lines changed

doc/api/axes_api.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,8 +509,6 @@ Interactive
509509
Axes.contains_point
510510

511511
Axes.get_cursor_data
512-
Axes.get_cursor_props
513-
Axes.set_cursor_props
514512

515513
Children
516514
========
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Removal of deprecated APIs
2+
``````````````````````````
3+
The following deprecated API elements have been removed:
4+
5+
- ``matplotlib.checkdep_tex``, ``matplotlib.checkdep_xmllint``,
6+
- ``backend_bases.IdleEvent``,
7+
- ``cbook.converter``, ``cbook.tostr``, ``cbook.todatetime``, ``cbook.todate``,
8+
``cbook.tofloat``, ``cbook.toint``, ``cbook.unique``,
9+
``cbook.is_string_like``, ``cbook.is_sequence_of_strings``,
10+
``cbook.is_scalar``, ``cbook.soundex``, ``cbook.dict_delall``,
11+
``cbook.get_split_ind``, ``cbook.wrap``, ``cbook.get_recursive_filelist``,
12+
``cbook.pieces``, ``cbook.exception_to_str``, ``cbook.allequal``,
13+
``cbook.alltrue``, ``cbook.onetrue``, ``cbook.allpairs``, ``cbook.finddir``,
14+
``cbook.reverse_dict``, ``cbook.restrict_dict``, ``cbook.issubclass_safe``,
15+
``cbook.recursive_remove``, ``cbook.unmasked_index_ranges``,
16+
``cbook.Null``, ``cbook.RingBuffer``, ``cbook.Sorter``, ``cbook.Xlator``,
17+
- ``font_manager.weight_as_number``, ``font_manager.ttfdict_to_fnames``,
18+
- ``pyplot.colors``,
19+
- ``rcsetup.validate_negative_linestyle``,
20+
``rcsetup.validate_negative_linestyle_legacy``,
21+
- ``testing.compare.verifiers``, ``testing.compare.verify``,
22+
- ``testing.decorators.knownfailureif``,
23+
``testing.decorators.ImageComparisonTest.remove_text``,
24+
- ``tests.assert_str_equal``, ``tests.test_tinypages.file_same``,
25+
- ``texmanager.dvipng_hack_alpha``,
26+
- ``_AxesBase.axesPatch``, ``_AxesBase.get_cursor_props``,
27+
``_AxesBase.set_cursor_props``,
28+
- ``_ImageBase.iterpnames``,
29+
- ``Figure.figurePatch``,
30+
- ``FigureCanvasBase.dynamic_update``, ``FigureCanvasBase.idle_event``,
31+
``FigureCanvasBase.get_linestyle``, ``FigureCanvasBase.set_linestyle``,
32+
- ``FigureCanvasQTAgg.blitbox``,
33+
- passing ``frac`` to ``PolarAxes.set_theta_grids``,

lib/matplotlib/__init__.py

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -459,23 +459,6 @@ def checkdep_ghostscript():
459459
checkdep_ghostscript.version = None
460460

461461

462-
# Deprecated, as it is unneeded and some distributions (e.g. MiKTeX 2.9.6350)
463-
# do not actually report the TeX version.
464-
@cbook.deprecated("2.1")
465-
def checkdep_tex():
466-
try:
467-
s = subprocess.Popen([str('tex'), '-version'], stdout=subprocess.PIPE,
468-
stderr=subprocess.PIPE)
469-
stdout, stderr = s.communicate()
470-
line = stdout.decode('ascii').split('\n')[0]
471-
pattern = r'3\.1\d+'
472-
match = re.search(pattern, line)
473-
v = match.group(0)
474-
return v
475-
except (IndexError, ValueError, AttributeError, OSError):
476-
return None
477-
478-
479462
def checkdep_pdftops():
480463
try:
481464
s = subprocess.Popen([str('pdftops'), '-v'], stdout=subprocess.PIPE,
@@ -509,23 +492,6 @@ def checkdep_inkscape():
509492
checkdep_inkscape.version = None
510493

511494

512-
@cbook.deprecated("2.1")
513-
def checkdep_xmllint():
514-
try:
515-
s = subprocess.Popen([str('xmllint'), '--version'],
516-
stdout=subprocess.PIPE,
517-
stderr=subprocess.PIPE)
518-
stdout, stderr = s.communicate()
519-
lines = stderr.decode('ascii').split('\n')
520-
for line in lines:
521-
if 'version' in line:
522-
v = line.split()[-1]
523-
break
524-
return v
525-
except (IndexError, ValueError, UnboundLocalError, OSError):
526-
return None
527-
528-
529495
def checkdep_ps_distiller(s):
530496
if not s:
531497
return False

lib/matplotlib/axes/_base.py

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@
4040

4141
rcParams = matplotlib.rcParams
4242

43-
is_string_like = cbook.is_string_like
44-
is_sequence_of_strings = cbook.is_sequence_of_strings
45-
4643
_hold_msg = """axes.hold is deprecated.
4744
See the API Changes document (http://matplotlib.org/api/api_changes.html)
4845
for more details."""
@@ -1131,11 +1128,6 @@ def cla(self):
11311128

11321129
self.stale = True
11331130

1134-
@property
1135-
@cbook.deprecated("2.1", alternative="Axes.patch")
1136-
def axesPatch(self):
1137-
return self.patch
1138-
11391131
def clear(self):
11401132
"""Clear the axes."""
11411133
self.cla()
@@ -4043,38 +4035,6 @@ def format_deltas(key, dx, dy):
40434035
self.set_xlim(points[:, 0])
40444036
self.set_ylim(points[:, 1])
40454037

4046-
@cbook.deprecated("2.1")
4047-
def get_cursor_props(self):
4048-
"""
4049-
Return the cursor propertiess as a (*linewidth*, *color*)
4050-
tuple, where *linewidth* is a float and *color* is an RGBA
4051-
tuple
4052-
"""
4053-
return self._cursorProps
4054-
4055-
@cbook.deprecated("2.1")
4056-
def set_cursor_props(self, *args):
4057-
"""Set the cursor property as
4058-
4059-
Call signature ::
4060-
4061-
ax.set_cursor_props(linewidth, color)
4062-
4063-
or::
4064-
4065-
ax.set_cursor_props((linewidth, color))
4066-
4067-
ACCEPTS: a (*float*, *color*) tuple
4068-
"""
4069-
if len(args) == 1:
4070-
lw, c = args[0]
4071-
elif len(args) == 2:
4072-
lw, c = args
4073-
else:
4074-
raise ValueError('args must be a (linewidth, color) tuple')
4075-
c = mcolors.to_rgba(c)
4076-
self._cursorProps = lw, c
4077-
40784038
def get_children(self):
40794039
"""return a list of child artists"""
40804040
children = []

lib/matplotlib/backend_bases.py

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -954,14 +954,6 @@ def get_joinstyle(self):
954954
"""
955955
return self._joinstyle
956956

957-
@cbook.deprecated("2.1")
958-
def get_linestyle(self):
959-
"""
960-
Return the linestyle: one of ('solid', 'dashed', 'dashdot',
961-
'dotted').
962-
"""
963-
return self._linestyle
964-
965957
def get_linewidth(self):
966958
"""
967959
Return the line width in points as a scalar
@@ -1105,17 +1097,6 @@ def set_linewidth(self, w):
11051097
"""
11061098
self._linewidth = float(w)
11071099

1108-
@cbook.deprecated("2.1")
1109-
def set_linestyle(self, style):
1110-
"""
1111-
Set the linestyle to be one of ('solid', 'dashed', 'dashdot',
1112-
'dotted'). These are defined in the rcParams
1113-
`lines.dashed_pattern`, `lines.dashdot_pattern` and
1114-
`lines.dotted_pattern`. One may also specify customized dash
1115-
styles by providing a tuple of (offset, dash pairs).
1116-
"""
1117-
self._linestyle = style
1118-
11191100
def set_url(self, url):
11201101
"""
11211102
Sets the url for links in compatible backends
@@ -1406,14 +1387,6 @@ def __init__(self, name, canvas, guiEvent=None):
14061387
self.guiEvent = guiEvent
14071388

14081389

1409-
@cbook.deprecated("2.1")
1410-
class IdleEvent(Event):
1411-
"""
1412-
An event triggered by the GUI backend when it is idle -- useful
1413-
for passive animation
1414-
"""
1415-
1416-
14171390
class DrawEvent(Event):
14181391
"""
14191392
An event triggered by a draw operation on the canvas
@@ -2014,13 +1987,6 @@ def enter_notify_event(self, guiEvent=None, xy=None):
20141987
event = Event('figure_enter_event', self, guiEvent)
20151988
self.callbacks.process('figure_enter_event', event)
20161989

2017-
@cbook.deprecated("2.1")
2018-
def idle_event(self, guiEvent=None):
2019-
"""Called when GUI is idle."""
2020-
s = 'idle_event'
2021-
event = IdleEvent(s, self, guiEvent=guiEvent)
2022-
self.callbacks.process(s, event)
2023-
20241990
def grab_mouse(self, ax):
20251991
"""
20261992
Set the child axes which are currently grabbing the mouse events.
@@ -2814,10 +2780,6 @@ def back(self, *args):
28142780
self.set_history_buttons()
28152781
self._update_view()
28162782

2817-
@cbook.deprecated("2.1", alternative="canvas.draw_idle")
2818-
def dynamic_update(self):
2819-
self.canvas.draw_idle()
2820-
28212783
def draw_rubberband(self, event, x0, y0, x1, y1):
28222784
"""Draw a rectangle rubberband to indicate zoom limits.
28232785

lib/matplotlib/backends/backend_qt5agg.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ def __init__(self, figure):
2020
super().__init__(figure=figure)
2121
self._bbox_queue = []
2222

23-
@property
24-
@cbook.deprecated("2.1")
25-
def blitbox(self):
26-
return self._bbox_queue
27-
2823
def paintEvent(self, e):
2924
"""Copy the image from the Agg canvas to the qt.drawable.
3025

lib/matplotlib/backends/backend_wx.py

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -501,27 +501,6 @@ def set_joinstyle(self, js):
501501
self.gfx_ctx.SetPen(self._pen)
502502
self.unselect()
503503

504-
@cbook.deprecated("2.1")
505-
def set_linestyle(self, ls):
506-
"""
507-
Set the line style to be one of
508-
"""
509-
DEBUG_MSG("set_linestyle()", 1, self)
510-
self.select()
511-
GraphicsContextBase.set_linestyle(self, ls)
512-
try:
513-
self._style = wxc.dashd_wx[ls]
514-
except KeyError:
515-
self._style = wx.LONG_DASH # Style not used elsewhere...
516-
517-
# On MS Windows platform, only line width of 1 allowed for dash lines
518-
if wx.Platform == '__WXMSW__':
519-
self.set_linewidth(1)
520-
521-
self._pen.SetStyle(self._style)
522-
self.gfx_ctx.SetPen(self._pen)
523-
self.unselect()
524-
525504
def get_wxcolour(self, color):
526505
"""return a wx.Colour from RGB format"""
527506
DEBUG_MSG("get_wx_color()", 1, self)
@@ -1591,14 +1570,6 @@ def set_cursor(self, cursor):
15911570
self.canvas.SetCursor(cursor)
15921571
self.canvas.Update()
15931572

1594-
@cbook.deprecated("2.1", alternative="canvas.draw_idle")
1595-
def dynamic_update(self):
1596-
d = self._idle
1597-
self._idle = False
1598-
if d:
1599-
self.canvas.draw()
1600-
self._idle = True
1601-
16021573
def press(self, event):
16031574
if self._active == 'ZOOM':
16041575
if not self.retinaFix:

0 commit comments

Comments
 (0)