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

Skip to content

Commit 1cba817

Browse files
committed
Removed unused variables etc.
1 parent bf3c651 commit 1cba817

File tree

6 files changed

+14
-22
lines changed

6 files changed

+14
-22
lines changed

lib/matplotlib/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1229,7 +1229,6 @@ def test(verbosity=None, coverage=False, **kwargs):
12291229
return -1
12301230

12311231
old_backend = get_backend()
1232-
old_recursionlimit = sys.getrecursionlimit()
12331232
try:
12341233
use('agg')
12351234

lib/matplotlib/axes/_axes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2153,7 +2153,7 @@ def _convert_dx(dx, x0, xconv, convert):
21532153
try:
21542154
x0 = cbook.safe_first_element(x0)
21552155
except (TypeError, IndexError, KeyError):
2156-
x0 = x0
2156+
pass
21572157

21582158
try:
21592159
x = cbook.safe_first_element(xconv)
@@ -5516,7 +5516,7 @@ def _pcolorargs(self, funcname, *args, shading='auto', **kwargs):
55165516
_valid_shading = ['gouraud', 'nearest', 'flat', 'auto']
55175517
try:
55185518
_api.check_in_list(_valid_shading, shading=shading)
5519-
except ValueError as err:
5519+
except ValueError:
55205520
_api.warn_external(f"shading value '{shading}' not in list of "
55215521
f"valid values {_valid_shading}. Setting "
55225522
"shading='auto'.")

lib/matplotlib/quiver.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -938,8 +938,6 @@ def __init__(self, ax, *args,
938938
transform = kwargs.pop('transform', ax.transData)
939939
self._pivot = pivot
940940
self._length = length
941-
barbcolor = barbcolor
942-
flagcolor = flagcolor
943941

944942
# Flagcolor and barbcolor provide convenience parameters for
945943
# setting the facecolor and edgecolor, respectively, of the barb

lib/matplotlib/text.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,6 @@ def _get_layout(self, renderer):
352352
xmax = width
353353
ymax = 0
354354
ymin = ys[-1] - descent # baseline of last line minus its descent
355-
height = ymax - ymin
356355

357356
# get the rotation matrix
358357
M = Affine2D().rotate_deg(self.get_rotation())

lib/matplotlib/widgets.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3066,9 +3066,6 @@ def _onmove(self, event):
30663066
- Re-size
30673067
- Continue the creation of a new shape
30683068
"""
3069-
state = self._state
3070-
rotate = ('rotate' in state and
3071-
self._active_handle in self._corner_order)
30723069
eventpress = self._eventpress
30733070
# The calculations are done for rotation at zero: we apply inverse
30743071
# transformation to events except when we rotate and move

tools/subset.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ def subset_font(font_in, font_out, unicodes, opts):
182182

183183
def getsubset(subset, font_in):
184184
subsets = subset.split('+')
185-
186185
quotes = [
187186
0x2013, # endash
188187
0x2014, # emdash
@@ -220,16 +219,16 @@ def getsubset(subset, font_in):
220219

221220
result = quotes
222221

223-
if 'menu' in subset:
222+
if 'menu' in subsets:
224223
font = fontforge.open(font_in)
225224
result = [
226225
*map(ord, font.familyname),
227226
0x0020,
228227
]
229228

230-
if 'latin' in subset:
229+
if 'latin' in subsets:
231230
result += latin
232-
if 'latin-ext' in subset:
231+
if 'latin-ext' in subsets:
233232
# These ranges include Extended A, B, C, D, and Additional with the
234233
# exception of Vietnamese, which is a separate range
235234
result += [
@@ -240,7 +239,7 @@ def getsubset(subset, font_in):
240239
*range(0x2c60, 0x2c80),
241240
*range(0xa700, 0xa800),
242241
]
243-
if 'vietnamese' in subset:
242+
if 'vietnamese' in subsets:
244243
# 2011-07-16 DC: Charset from
245244
# http://vietunicode.sourceforge.net/charset/ + U+1ef9 from Fontaine
246245
result += [0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00C8, 0x00C9,
@@ -251,16 +250,16 @@ def getsubset(subset, font_in):
251250
0x00FA, 0x00FD, 0x0102, 0x0103, 0x0110, 0x0111,
252251
0x0128, 0x0129, 0x0168, 0x0169, 0x01A0, 0x01A1,
253252
0x01AF, 0x01B0, 0x20AB, *range(0x1EA0, 0x1EFA)]
254-
if 'greek' in subset:
253+
if 'greek' in subsets:
255254
# Could probably be more aggressive here and exclude archaic
256255
# characters, but lack data
257256
result += [*range(0x370, 0x400)]
258-
if 'greek-ext' in subset:
257+
if 'greek-ext' in subsets:
259258
result += [*range(0x370, 0x400), *range(0x1f00, 0x2000)]
260-
if 'cyrillic' in subset:
259+
if 'cyrillic' in subsets:
261260
# Based on character frequency analysis
262261
result += [*range(0x400, 0x460), 0x490, 0x491, 0x4b0, 0x4b1, 0x2116]
263-
if 'cyrillic-ext' in subset:
262+
if 'cyrillic-ext' in subsets:
264263
result += [
265264
*range(0x400, 0x530),
266265
0x20b4,
@@ -270,7 +269,7 @@ def getsubset(subset, font_in):
270269
*range(0x2de0, 0x2e00),
271270
*range(0xa640, 0xa6a0),
272271
]
273-
if 'arabic' in subset:
272+
if 'arabic' in subsets:
274273
# Based on Droid Arabic Kufi 1.0
275274
result += [0x000D, 0x0020, 0x0621, 0x0627, 0x062D,
276275
0x062F, 0x0631, 0x0633, 0x0635, 0x0637, 0x0639,
@@ -322,7 +321,7 @@ def getsubset(subset, font_in):
322321
0x063b, 0x063c, 0x063d, 0x063e, 0x063f, 0x0620,
323322
0x0674, 0x0674, 0x06EC]
324323

325-
if 'dejavu-ext' in subset:
324+
if 'dejavu-ext' in subsets:
326325
# add all glyphnames ending in .display
327326
font = fontforge.open(font_in)
328327
for glyph in font.glyphs():
@@ -335,10 +334,10 @@ def getsubset(subset, font_in):
335334
# code for extracting vertical metrics from a TrueType font
336335
class Sfnt:
337336
def __init__(self, data):
338-
version, numTables, _, _, _ = struct.unpack('>IHHHH', data[:12])
337+
_, numTables, _, _, _ = struct.unpack('>IHHHH', data[:12])
339338
self.tables = {}
340339
for i in range(numTables):
341-
tag, checkSum, offset, length = struct.unpack(
340+
tag, _, offset, length = struct.unpack(
342341
'>4sIII', data[12 + 16 * i: 28 + 16 * i])
343342
self.tables[tag] = data[offset: offset + length]
344343

0 commit comments

Comments
 (0)