8000 Remove most APIs deprecated in 2.1. by anntzer · Pull Request #10608 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Remove most APIs deprecated in 2.1. #10608

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 2 commits into from
Mar 4, 2018
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
2 changes: 0 additions & 2 deletions doc/api/axes_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,6 @@ Interactive
Axes.contains_point

Axes.get_cursor_data
Axes.get_cursor_props
Axes.set_cursor_props

Children
========
Expand Down
33 changes: 33 additions & 0 deletions doc/api/next_api_changes/2018-02-26-AL-removals.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Removal of deprecated APIs
``````````````````````````
The following deprecated API elements have been removed:

- ``matplotlib.checkdep_tex``, ``matplotlib.checkdep_xmllint``,
- ``backend_bases.IdleEvent``,
- ``cbook.converter``, ``cbook.tostr``, ``cbook.todatetime``, ``cbook.todate``,
``cbook.tofloat``, ``cbook.toint``, ``cbook.unique``,
``cbook.is_string_like``, ``cbook.is_sequence_of_strings``,
``cbook.is_scalar``, ``cbook.soundex``, ``cbook.dict_delall``,
``cbook.get_split_ind``, ``cbook.wrap``, ``cbook.get_recursive_filelist``,
``cbook.pieces``, ``cbook.exception_to_str``, ``cbook.allequal``,
``cbook.alltrue``, ``cbook.onetrue``, ``cbook.allpairs``, ``cbook.finddir``,
``cbook.reverse_dict``, ``cbook.restrict_dict``, ``cbook.issubclass_safe``,
``cbook.recursive_remove``, ``cbook.unmasked_index_ranges``,
``cbook.Null``, ``cbook.RingBuffer``, ``cbook.Sorter``, ``cbook.Xlator``,
- ``font_manager.weight_as_number``, ``font_manager.ttfdict_to_fnames``,
- ``pyplot.colors``,
- ``rcsetup.validate_negative_linestyle``,
``rcsetup.validate_negative_linestyle_legacy``,
- ``testing.compare.verifiers``, ``testing.compare.verify``,
- ``testing.decorators.knownfailureif``,
``testing.decorators.ImageComparisonTest.remove_text``,
- ``tests.assert_str_equal``, ``tests.test_tinypages.file_same``,
- ``texmanager.dvipng_hack_alpha``,
- ``_AxesBase.axesPatch``, ``_AxesBase.get_cursor_props``,
``_AxesBase.set_cursor_props``,
- ``_ImageBase.iterpnames``,
- ``Figure.figurePatch``,
- ``FigureCanvasBase.dynamic_update``, ``FigureCanvasBase.idle_event``,
``FigureCanvasBase.get_linestyle``, ``FigureCanvasBase.set_linestyle``,
- ``FigureCanvasQTAgg.blitbox``,
- passing ``frac`` to ``PolarAxes.set_theta_grids``,
34 changes: 0 additions & 34 deletions lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,23 +459,6 @@ def checkdep_ghostscript():
checkdep_ghostscript.version = None


# Deprecated, as it is unneeded and some distributions (e.g. MiKTeX 2.9.6350)
# do not actually report the TeX version.
@cbook.deprecated("2.1")
def checkdep_tex():
try:
s = subprocess.Popen([str('tex'), '-version'], stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = s.communicate()
line = stdout.decode('ascii').split('\n')[0]
pattern = r'3\.1\d+'
match = re.search(pattern, line)
v = match.group(0)
return v
except (IndexError, ValueError, AttributeError, OSError):
return None


def checkdep_pdftops():
try:
s = subprocess.Popen([str('pdftops'), '-v'], stdout=subprocess.PIPE,
Expand Down Expand Up @@ -509,23 +492,6 @@ def checkdep_inkscape():
checkdep_inkscape.version = None


@cbook.deprecated("2.1")
def checkdep_xmllint():
try:
s = subprocess.Popen([str('xmllint'), '--version'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = s.communicate()
lines = stderr.decode('ascii').split('\n')
for line in lines:
if 'version' in line:
v = line.split()[-1]
break
return v
except (IndexError, ValueError, UnboundLocalError, OSError):
return None


def checkdep_ps_distiller(s):
if not s:
return False
Expand Down
40 changes: 0 additions & 40 deletions lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@

rcParams = matplotlib.rcParams

is_string_like = cbook.is_string_like
is_sequence_of_strings = cbook.is_sequence_of_strings

_hold_msg = """axes.hold is deprecated.
See the API Changes document (http://matplotlib.org/api/api_changes.html)
for more details."""
Expand Down Expand Up @@ -1131,11 +1128,6 @@ def cla(self):

self.stale = True

@property
@cbook.deprecated("2.1", alternative="Axes.patch")
def axesPatch(self):
return self.patch

def clear(self):
"""Clear the axes."""
self.cla()
Expand Down Expand Up @@ -4043,38 +4035,6 @@ def format_deltas(key, dx, dy):
self.set_xlim(points[:, 0])
self.set_ylim(points[:, 1])

@cbook.deprecated("2.1")
def get_cursor_props(self):
"""
Return the cursor propertiess as a (*linewidth*, *color*)
tuple, where *linewidth* is a float and *color* is an RGBA
tuple
"""
return self._cursorProps

@cbook.deprecated("2.1")
def set_cursor_props(self, *args):
"""Set the cursor property as

Call signature ::

ax.set_cursor_props(linewidth, color)

or::

ax.set_cursor_props((linewidth, color))

ACCEPTS: a (*float*, *color*) tuple
"""
if len(args) == 1:
lw, c = args[0]
elif len(args) == 2:
lw, c = args
else:
raise ValueError('args must be a (linewidth, color) tuple')
c = mcolors.to_rgba(c)
self._cursorProps = lw, c

def get_children(self):
"""return a list of child artists"""
children = []
Expand Down
38 changes: 0 additions & 38 deletions lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -954,14 +954,6 @@ def get_joinstyle(self):
"""
return self._joinstyle

@cbook.deprecated("2.1")
def get_linestyle(self):
"""
Return the linestyle: one of ('solid', 'dashed', 'dashdot',
'dotted').
"""
return self._linestyle

def get_linewidth(self):
"""
Return the line width in points as a scalar
Expand Down Expand Up @@ -1105,17 +1097,6 @@ def set_linewidth(self, w):
"""
self._linewidth = float(w)

@cbook.deprecated("2.1")
def set_linestyle(self, style):
"""
Set the linestyle to be one of ('solid', 'dashed', 'dashdot',
'dotted'). These are defined in the rcParams
`lines.dashed_pattern`, `lines.dashdot_pattern` and
`lines.dotted_pattern`. One may also specify customized dash
styles by providing a tuple of (offset, dash pairs).
"""
self._linestyle = style

def set_url(self, url):
"""
Sets the url for links in compatible backends
Expand Down Expand Up @@ -1406,14 +1387,6 @@ def __init__(self, name, canvas, guiEvent=None):
self.guiEvent = guiEvent


@cbook.deprecated("2.1")
class IdleEvent(Event):
"""
An event triggered by the GUI backend when it is idle -- useful
for passive animation
"""


class DrawEvent(Event):
"""
An event triggered by a draw operation on the canvas
Expand Down Expand Up @@ -2014,13 +1987,6 @@ def enter_notify_event(self, guiEvent=None, xy=None):
event = Event('figure_enter_event', self, guiEvent)
self.callbacks.process('figure_enter_event', event)

@cbook.deprecated("2.1")
def idle_event(self, guiEvent=None):
"""Called when GUI is idle."""
s = 'idle_event'
event = IdleEvent(s, self, guiEvent=guiEvent)
self.callbacks.process(s, event)

def grab_mouse(self, ax):
"""
Set the child axes which are currently grabbing the mouse events.
Expand Down Expand Up @@ -2814,10 +2780,6 @@ def back(self, *args):
self.set_history_buttons()
self._update_view()

@cbook.deprecated("2.1", alternative="canvas.draw_idle")
def dynamic_update(self):
self.canvas.draw_idle()

def draw_rubberband(self, event, x0, y0, x1, y1):
"""Draw a rectangle rubberband to indicate zoom limits.

Expand Down
5 changes: 0 additions & 5 deletions lib/matplotlib/backends/backend_qt5agg.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ def __init__(self, figure):
super().__init__(figure=figure)
self._bbox_queue = []

@property
@cbook.deprecated("2.1")
def blitbox(self):
return self._bbox_queue

def paintEvent(self, e):
"""Copy the image from the Agg canvas to the qt.drawable.

Expand Down
29 changes: 0 additions & 29 deletions lib/matplotlib/backends/backend_wx.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,27 +501,6 @@ def set_joinstyle(self, js):
self.gfx_ctx.SetPen(self._pen)
self.unselect()

@cbook.deprecated("2.1")
def set_linestyle(self, ls):
"""
Set the line style to be one of
"""
DEBUG_MSG("set_linestyle()", 1, self)
self.select()
GraphicsContextBase.set_linestyle(self, ls)
try:
self._style = wxc.dashd_wx[ls]
except KeyError:
self._style = wx.LONG_DASH # Style not used elsewhere...

# On MS Windows platform, only line width of 1 allowed for dash lines
if wx.Platform == '__WXMSW__':
self.set_linewidth(1)

self._pen.SetStyle(self._style)
self.gfx_ctx.SetPen(self._pen)
self.unselect()

def get_wxcolour(self, color):
"""return a wx.Colour from RGB format"""
DEBUG_MSG("get_wx_color()", 1, self)
Expand Down Expand Up @@ -1591,14 +1570,6 @@ def set_cursor(self, cursor):
self.canvas.SetCursor(cursor)
self.canvas.Update()

@cbook.deprecated("2.1", alternative="canvas.draw_idle")
def dynamic_update(self):
d = self._idle
self._idle = False
if d:
self.canvas.draw()
self._idle = True

def press(self, event):
if self._active == 'ZOOM':
if not self.retinaFix:
Expand Down
Loading
0