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

Skip to content

Commit e83a0f8

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

File tree

15 files changed

+42
-41
lines changed

15 files changed

+42
-41
lines changed
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)

lib/matplotlib/patheffects.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,6 @@ def __init__(self, offset=(2, -2),
249249
#: The dictionary of keywords to update the graphics collection with.
250250
self._gc = kwargs
251251

252-
#: The offset transform object. The offset isn't calculated yet
253-
#: as we don't know how big the figure will be in pixels.
254-
self._offset_tran = mtransforms.Affine2D()
255-
256252
def draw_path(self, renderer, gc, tpath, affine, rgbFace):
257253
"""
258254
Overrides the standard draw_path to add the shadow offset and
@@ -313,7 +309,6 @@ def __init__(self, offset=(2, -2),
313309
**kwargs
314310
Extra keywords are stored and passed through to
315311
:meth:`AbstractPathEffect._update_gc`.
316-
317312
"""
318313
super().__init__(offset)
319314
if shadow_color is None:
@@ -322,14 +317,9 @@ def __init__(self, offset=(2, -2),
322317
self._shadow_color = mcolors.to_rgba(shadow_color)
323318
self._alpha = alpha
324319
self._rho = rho
325-
326320
#: The dictionary of keywords to update the graphics collection with.
327321
self._gc = kwargs
328322

329-
#: The offset transform object. The offset isn't calculated yet
330-
#: as we don't know how big the figure will be in pixels.
331-
self._offset_tran = mtransforms.Affine2D()
332-
333323
def draw_path(self, renderer, gc, tpath, affine, rgbFace):
334324
"""
335325
Overrides the standard draw_path to add the shadow offset and

lib/matplotlib/quiver.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,9 +475,6 @@ def __init__(self, ax, *args,
475475
self.set_UVC(U, V, C)
476476
self._initialized = False
477477

478-
self.keyvec = None
479-
self.keytext = None
480-
481478
# try to prevent closure over the real self
482479
weak_self = weakref.ref(self)
483480

@@ -499,6 +496,16 @@ def on_dpi_change(fig):
499496
def color(self):
500497
return self.get_facecolor()
501498

499+
@cbook.deprecated("3.1")
500+
@property
501+
def keyvec(self):
502+
return None
503+
504+
@cbook.deprecated("3.1")
505+
@property
506+
def keytext(self):
507+
return None
508+
502509
def remove(self):
503510
"""
504511
Overload the remove method

lib/matplotlib/table.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,8 @@ def __init__(self, ax, loc=None, bbox=None, **kwargs):
322322
# use axes coords
323323
self.set_transform(ax.transAxes)
324324

325-
self._texts = []
326325
self._cells = {}
327326
self._edges = None
328-
self._autoRows = []
329327
self._autoColumns = []
330328
self._autoFontsize = True
331329
self.update(kwargs)

lib/matplotlib/testing/compare.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ def _read_until(self, terminator):
173173
class _GSConverter(_Converter):
174174
def __call__(self, orig, dest):
175175
if not self._proc:
176-
self._stdout = TemporaryFile()
177176
self._proc = subprocess.Popen(
178177
[mpl._get_executable_info("gs").executable,
179178
"-dNOPAUSE", "-sDEVICE=png16m"],

lib/matplotlib/widgets.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1837,7 +1837,6 @@ def _release(self, event):
18371837
"""on button release event"""
18381838
if self.pressv is None:
18391839
return
1840-
self.buttonDown = False
18411840

18421841
self.rect.set_visible(False)
18431842

@@ -1865,6 +1864,11 @@ def _release(self, event):
18651864
self.pressv = None
18661865
return False
18671866

1867+
@cbook.deprecated("3.1")
1868+
@property
1869+
def buttonDown(self):
1870+
return False
1871+
18681872
def _onmove(self, event):
18691873
"""on motion notify event"""
18701874
if self.pressv is None:

0 commit comments

Comments
 (0)