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

Skip to content

Commit 3c55e01

Browse files
committed
Minor cleanups.
- backend_ps.get_bbox has been marked as deprecated in comment since 2010; deprecate it for real. - Reword the docstring for Legend.set_draggable. - Use star-unpacking instead of set.union.
1 parent 23c9542 commit 3c55e01

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ The following classes, methods, functions, and attributes are deprecated:
1212

1313
- ``afm.parse_afm``,
1414
- ``backend_pgf.get_texcommand``,
15+
- ``backend_ps.get_bbox``,
1516
- ``backend_qt5.error_msg_qt``, ``backend_qt5.exception_handler``,
1617
- ``backend_wx.FigureCanvasWx.macros``,
1718
- ``cbook.GetRealpathAndStat``, ``cbook.Locked``,

lib/matplotlib/backends/backend_ps.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,6 +1593,7 @@ def get_bbox_header(lbrt, rotated=False):
15931593

15941594
# get_bbox is deprecated. I don't see any reason to use ghostscript to
15951595
# find the bounding box, as the required bounding box is alread known.
1596+
@cbook.deprecated("3.0")
15961597
def get_bbox(tmpfile, bbox):
15971598
"""
15981599
Use ghostscript's bbox device to find the center of the bounding box.

lib/matplotlib/legend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ def set_draggable(self, state, use_blit=False, update='loc'):
11241124
Parameters
11251125
----------
11261126
state : bool
1127-
``True`` / ``False`` enables / disables mouse dragging.
1127+
Whether mouse dragging is enabled.
11281128
use_blit : bool, optional
11291129
Use blitting for faster image composition. For details see
11301130
:ref:`func-animation`.

lib/matplotlib/tests/test_rcparams.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -457,11 +457,8 @@ def test_rcparams_reset_after_fail():
457457

458458

459459
def test_if_rctemplate_is_up_to_date():
460-
# This tests if the matplotlibrc.template file
461-
# contains all valid rcParams.
462-
dep1 = mpl._all_deprecated
463-
dep2 = mpl._deprecated_set
464-
deprecated = list(dep1.union(dep2))
460+
# This tests if the matplotlibrc.template file contains all valid rcParams.
461+
deprecated = {*mpl._all_deprecated, *mpl._deprecated_set}
465462
path_to_rc = os.path.join(mpl.get_data_path(), 'matplotlibrc')
466463
with open(path_to_rc, "r") as f:
467464
rclines = f.readlines()

0 commit comments

Comments
 (0)