Skip to content

Commit 1279b84

Browse files
committed
Remove most APIs deprecated in 2.1.
Only exception is axes_grid, whose removal should be accompanied by an update to the docs.
1 parent 74b6913 commit 1279b84

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
@@ -458,23 +458,6 @@ def checkdep_ghostscript():
458458
checkdep_ghostscript.version = None
459459

460460

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

510493

511-
@cbook.deprecated("2.1")
512-
def checkdep_xmllint():
513-
try:
514-
s = subprocess.Popen([str('xmllint'), '--version'],
515-
stdout=subprocess.PIPE,
516-
stderr=subprocess.PIPE)
517-
stdout, stderr = s.communicate()
518-
lines = stderr.decode('ascii').split('\n')
519-
for line in lines:
520-
if 'version' in line:
521-
v = line.split()[-1]
522-
break
523-
return v
524-
except (IndexError, ValueError, UnboundLocalError, OSError):
525-
return None
526-
527-
528494
def checkdep_ps_distiller(s):
529495
if not s:
530496
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."""
@@ -1135,11 +1132,6 @@ def cla(self):
11351132

11361133
self.stale = True
11371134

1138-
@property
1139-
@cbook.deprecated("2.1", alternative="Axes.patch")
1140-
def axesPatch(self):
1141-
return self.patch
1142-
11431135
def clear(self):
11441136
"""Clear the axes."""
11451137
self.cla()
@@ -4047,38 +4039,6 @@ def format_deltas(key, dx, dy):
40474039
self.set_xlim(points[:, 0])
40484040
self.set_ylim(points[:, 1])
40494041

4050-
@cbook.deprecated("2.1")
4051-
def get_cursor_props(self):
4052-
"""
4053-
Return the cursor propertiess as a (*linewidth*, *color*)
4054-
tuple, where *linewidth* is a float and *color* is an RGBA
4055-
tuple
4056-
"""
4057-
return self._cursorProps
4058-
4059-
@cbook.deprecated("2.1")
4060-
def set_cursor_props(self, *args):
4061-
"""Set the cursor property as
4062-
4063-
Call signature ::
4064-
4065-
ax.set_cursor_props(linewidth, color)
4066-
4067-
or::
4068-
4069-
ax.set_cursor_props((linewidth, color))
4070-
4071-
ACCEPTS: a (*float*, *color*) tuple
4072-
"""
4073-
if len(args) == 1:
4074-
lw, c = args[0]
4075-
elif len(args) == 2:
4076-
lw, c = args
4077-
else:
4078-
raise ValueError('args must be a (linewidth, color) tuple')
4079-
c = mcolors.to_rgba(c)
4080-
self._cursorProps = lw, c
4081-
40824042
def get_children(self):
40834043
"""return a list of child artists"""
40844044
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
@@ -24,11 +24,6 @@ def __init__(self, figure):
2424
super().__init__(figure=figure)
2525
self._bbox_queue = []
2626

27-
@property
28-
@cbook.deprecated("2.1")
29-
def blitbox(self):
30-
return self._bbox_queue
31-
3227
def paintEvent(self, e):
3328
"""Copy the image from the Agg canvas to the qt.drawable.
3429

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)