Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e381007

Browse files
committed
Some more deprecations of old, old stuff.
(I think 2018 qualifies as beyond "the near future" of "sometime after 2008-08-01", but YMMV...)
1 parent 0722828 commit e381007

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

doc/api/next_api_changes/2018-02-15-AL-deprecations.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ The following classes, methods, functions, and attributes are deprecated:
1515
- ``backend_wx.FigureCanvasWx.macros``,
1616
- ``cbook.GetRealpathAndStat``, ``cbook.Locked``,
1717
- ``cbook.is_numlike`` (use ``isinstance(..., numbers.Number)`` instead),
18-
``cbook.listFiles``, ``cbook.unicode_safe``
18+
``cbook.listFiles``, ``cbook.unicode_safe``,
1919
- ``container.Container.set_remove_method``,
20+
- ``contour.ContourLabeler.cl``, ``.cl_xy``, and ``.cl_cvalues``,
2021
- ``dates.DateFormatter.strftime_pre_1900``, ``dates.DateFormatter.strftime``,
2122
- ``font_manager.TempCache``,
2223
- ``mathtext.unichr_safe`` (use ``chr`` instead),
24+
- ``table.Table.get_child_artists`` (use ``get_children`` instead),
2325
- ``testing.compare.ImageComparisonTest``, ``testing.compare.compare_float``,
2426
- ``testing.decorators.skip_if_command_unavailable``.
2527
- ``FigureCanvasQT.keyAutoRepeat`` (directly check

lib/matplotlib/contour.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -215,16 +215,16 @@ def clabel(self, *args, **kwargs):
215215
else:
216216
self.labels(inline, inline_spacing)
217217

218-
# Hold on to some old attribute names. These are deprecated and will
219-
# be removed in the near future (sometime after 2008-08-01), but
220-
# keeping for now for backwards compatibility
221-
self.cl = self.labelTexts
222-
self.cl_xy = self.labelXYs
223-
self.cl_cvalues = self.labelCValues
224-
225218
self.labelTextsList = cbook.silent_list('text.Text', self.labelTexts)
226219
return self.labelTextsList
227220

221+
cl = property(cbook.deprecated("3.0", alternative="labelTexts")(
222+
lambda self: self.labelTexts))
223+
cl_xy = property(cbook.deprecated("3.0", alternative="labelXYs")(
224+
lambda self: self.labelXYs))
225+
cl_cvalues = property(cbook.deprecated("3.0", alternative="labelCValues")(
226+
lambda self: self.labelCValues))
227+
228228
def print_label(self, linecontour, labelwidth):
229229
"Return *False* if contours are too short for a label."
230230
return (len(linecontour) > 10 * labelwidth

lib/matplotlib/figure.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1306,7 +1306,6 @@ def subplots(self, nrows=1, ncols=1, sharex=False, sharey=False,
13061306
pyplot.subplots : pyplot API; docstring includes examples.
13071307
"""
13081308

1309-
# for backwards compatibility
13101309
if isinstance(sharex, bool):
13111310
sharex = "all" if sharex else "none"
13121311
if isinstance(sharey, bool):

lib/matplotlib/table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ def contains(self, mouseevent):
382382
def get_children(self):
383383
"""Return the Artists contained by the table."""
384384
return list(self._cells.values())
385-
get_child_artists = get_children # backward compatibility
385+
get_child_artists = cbook.deprecated("3.0")(get_children)
386386

387387
def get_window_extent(self, renderer):
388388
"""Return the bounding box of the table in window coords."""

0 commit comments

Comments
 (0)