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

Skip to content

Commit e83a0f8

Browse files
QuLogicMeeseeksDev[bot]
authored andcommitted
Backport PR #13716: Kill attributes that are never used/updated.
1 parent afc4e61 commit e83a0f8

15 files changed

Lines changed: 42 additions & 41 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Deprecations
2+
````````````
3+
4+
The following (unused and never updated) attributes are deprecated:
5+
``NavigationToolbar2QT.buttons``, ``Line2D.verticalOffset``, ``Quiver.keytext``,
6+
``Quiver.keyvec``, ``SpanSelector.buttonDown``.
7+
8+
The ``interp_at_native`` parameter to ``BboxImage``, which has no effect since
9+
Matplotlib 2.0, is deprecated.

lib/matplotlib/backends/backend_pdf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,6 @@ def __init__(self, filename, metadata=None):
486486
self.fontNames = {} # maps filenames to internal font names
487487
self.nextFont = 1 # next free internal font name
488488
self.dviFontInfo = {} # maps dvi font names to embedding information
489-
self._texFontMap = None # maps TeX font names to PostScript fonts
490489
# differently encoded Type-1 fonts may share the same descriptor
491490
self.type1Descriptors = {}
492491
self.used_characters = {}

lib/matplotlib/backends/backend_qt5.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -711,8 +711,6 @@ def _init_toolbar(self):
711711
'Customize', self.edit_parameters)
712712
a.setToolTip('Edit axis, curve and image parameters')
713713

714-
self.buttons = {}
715-
716714
# Add the x,y location widget at the right side of the toolbar
717715
# The stretch factor is 1 which means any resizing of the toolbar
718716
# will resize this label instead of the buttons.
@@ -736,6 +734,11 @@ def _init_toolbar(self):
736734
self.setIconSize(QtCore.QSize(24, 24))
737735
self.layout().setSpacing(12)
738736

737+
@cbook.deprecated("3.1")
738+
@property
739+
def buttons(self):
740+
return {}
741+
739742
if is_pyqt5():
740743
# For some reason, self.setMinimumHeight doesn't seem to carry over to
741744
# the actual sizeHint, so override it instead in order to make the

lib/matplotlib/backends/backend_svg.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@ def __init__(self, width, height, svgwriter, basename=None, image_dpi=72):
283283
self.basename = basename
284284
self._imaged = {}
285285
self._clipd = OrderedDict()
286-
self._char_defs = {}
287286
self._markers = {}
288287
self._path_collection_id = 0
289288
self._imaged = {}

lib/matplotlib/backends/backend_wx.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,6 @@ def __init__(self, bitmap, renderer):
425425
self.gfx_ctx = gfx_ctx
426426
self._pen = wx.Pen('BLACK', 1, wx.SOLID)
427427
gfx_ctx.SetPen(self._pen)
428-
self._style = wx.SOLID
429428
self.renderer = renderer
430429

431430
def select(self):
@@ -1595,7 +1594,6 @@ def __init__(self, toolmanager, parent, style=wx.TB_HORIZONTAL):
15951594
wx.ToolBar.__init__(self, parent, -1, style=style)
15961595
self._toolitems = {}
15971596
self._groups = {}
1598-
self._last = None
15991597

16001598
def add_toolitem(
16011599
self, name, group, position, image_file, description, toggle):
@@ -1624,7 +1622,6 @@ def handler(event):
16241622
else:
16251623
control.Bind(wx.EVT_LEFT_DOWN, handler)
16261624

1627-
self._last = tool
16281625
self._toolitems.setdefault(name, [])
16291626
group.insert(position, tool)
16301627
self._toolitems[name].append((tool, handler))

lib/matplotlib/contour.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,6 @@ def _process_args(self, *args, **kwargs):
10661066
self.allkinds = len(args) > 2 and args[2] or None
10671067
self.zmax = np.max(self.levels)
10681068
self.zmin = np.min(self.levels)
1069-
self._auto = False
10701069

10711070
# Check lengths of levels and allsegs.
10721071
if self.filled:
@@ -1152,7 +1151,6 @@ def _autolev(self, N):
11521151
one contour line, but two filled regions, and therefore
11531152
three levels to provide boundaries for both regions.
11541153
"""
1155-
self._auto = True
11561154
if self.locator is None:
11571155
if self.logscale:
11581156
self.locator = ticker.LogLocator()
@@ -1186,7 +1184,6 @@ def _contour_level_args(self, z, args):
11861184
"""
11871185
Determine the contour levels and store in self.levels.
11881186
"""
1189-
self._auto = False
11901187
if self.levels is None:
11911188
if len(args) == 0:
11921189
levels_arg = 7 # Default, hard-wired.

lib/matplotlib/image.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,6 +1258,8 @@ def set_data(self, A):
12581258

12591259
class BboxImage(_ImageBase):
12601260
"""The Image class whose size is determined by the given bbox."""
1261+
1262+
@cbook._delete_parameter("3.1", "interp_at_native")
12611263
def __init__(self, bbox,
12621264
cmap=None,
12631265
norm=None,
@@ -1273,16 +1275,7 @@ def __init__(self, bbox,
12731275
cmap is a colors.Colormap instance
12741276
norm is a colors.Normalize instance to map luminance to 0-1
12751277
1276-
interp_at_native is a flag that determines whether or not
1277-
interpolation should still be applied when the image is
1278-
displayed at its native resolution. A common use case for this
1279-
is when displaying an image for annotational purposes; it is
1280-
treated similarly to Photoshop (interpolation is only used when
1281-
displaying the image at non-native resolutions).
1282-
1283-
12841278
kwargs are an optional list of Artist keyword args
1285-
12861279
"""
12871280
super().__init__(
12881281
None,
@@ -1297,9 +1290,14 @@ def __init__(self, bbox,
12971290
)
12981291

12991292
self.bbox = bbox
1300-
self.interp_at_native = interp_at_native
1293+
self._interp_at_native = interp_at_native
13011294
self._transform = IdentityTransform()
13021295

1296+
@cbook.deprecated("3.1")
1297+
@property
1298+
def interp_at_native(self):
1299+
return self._interp_at_native
1300+
13031301
def get_transform(self):
13041302
return self._transform
13051303

lib/matplotlib/legend.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,6 @@ def __init__(self, parent, handles, labels,
593593
title_fontsize = rcParams['legend.title_fontsize']
594594
tprop = FontProperties(size=title_fontsize)
595595
self.set_title(title, prop=tprop)
596-
self._last_fontsize_points = self._fontsize
597596
self._draggable = None
598597

599598
def _set_artist_props(self, a):

lib/matplotlib/lines.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,6 @@ def __init__(self, xdata, ydata,
400400
self.set_markeredgecolor(markeredgecolor)
401401
self.set_markeredgewidth(markeredgewidth)
402402

403-
self.verticalOffset = None
404-
405403
# update kwargs before updating data to give the caller a
406404
# chance to init axes (and hence unit support)
407405
self.update(kwargs)
@@ -424,6 +422,11 @@ def __init__(self, xdata, ydata,
424422

425423
self.set_data(xdata, ydata)
426424

425+
@cbook.deprecated("3.1")
426+
@property
427+
def verticalOffset(self):
428+
return None
429+
427430
def contains(self, mouseevent):
428431
"""
429432
Test whether the mouse event occurred on the line. The pick

lib/matplotlib/patches.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ def __init__(self,
9191
self.set_hatch(hatch)
9292
self.set_capstyle(capstyle)
9393
self.set_joinstyle(joinstyle)
94-
self._combined_transform = transforms.IdentityTransform()
9594

9695
if len(kwargs):
9796
self.update(kwargs)

0 commit comments

Comments
 (0)