8000 Merge pull request #2930 from tacaswell/cranky_pep8 · matplotlib/matplotlib@7d6d594 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7d6d594

Browse files
committed
Merge pull request #2930 from tacaswell/cranky_pep8
Cranky pep8
2 parents 2ee8617 + 6464e2d commit 7d6d594

File tree

5 files changed

+22
-8
lines changed

5 files changed

+22
-8
lines changed

lib/matplotlib/animation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ def save(self, filename, writer=None, fps=None, dpi=None, codec=None,
685685
bitrate = rcParams['animation.bitrate']
686686

687687
all_anim = [self]
688-
if not extra_anim is None:
688+
if extra_anim is not None:
689689
all_anim.extend(anim
690690
for anim
691691
in extra_anim if anim._fig is self._fig)

lib/matplotlib/axes/_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def _xy_from_xy(self, x, y):
232232

233233
def _makeline(self, x, y, kw, kwargs):
234234
kw = kw.copy() # Don't modify the original kw.
235-
if not 'color' in kw and not 'color' in kwargs:
235+
if 'color' not in kw and 'color' not in kwargs:
236236
kw['color'] = six.next(self.color_cycle)
237237
# (can't use setdefault because it always evaluates
238238
# its second argument)

lib/matplotlib/image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ def set_array(self, *args):
776776
raise NotImplementedError('Method not supported')
777777

778778
def set_interpolation(self, s):
779-
if s is not None and not s in ('nearest', 'bilinear'):
779+
if s is not None and s not in ('nearest', 'bilinear'):
780780
raise NotImplementedError('Only nearest neighbor and '
781781
'bilinear interpolations are supported')
782782
AxesImage.set_interpolation(self, s)

lib/matplotlib/tests/test_coding_standards.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,22 @@
3636
'_backend_gdk.py',
3737
'pyparsing*',
3838
'_qhull.py']
39-
PEP8_ADDITIONAL_IGNORE = ('E121', 'E122', 'E123', 'E124', 'E125',
40-
'E126', 'E127', 'E128')
39+
40+
PEP8_ADDITIONAL_IGNORE = ['E111',
41+
'E112',
42+
'E113',
43+
'E121',
44+
'E122',
45+
'E123',
46+
'E124',
47+
'E125',
48+
'E126',
49+
'E127',
50+
'E128',
51+
'E129',
52+
'E131',
53+
'E265']
54+
4155
EXPECTED_BAD_FILES = ['*/matplotlib/__init__.py',
4256
'*/matplotlib/_cm.py',
4357
'*/matplotlib/_mathtext_data.py',

lib/matplotlib/textpath.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def get_glyphs_with_font(self, font, s, glyph_map=None,
209209
horiz_advance = (glyph.linearHoriAdvance / 65536.0)
210210

211211
char_id = self._get_char_id(font, ccode)
212-
if not char_id in glyph_map:
212+
if char_id not in glyph_map:
213213
glyph_map_new[char_id] = self.glyph_to_path(font)
214214

215215
currx += (kern / 64.0)
@@ -258,7 +258,7 @@ def get_glyphs_mathtext(self, prop, s, glyph_map=None,
258258
currx, curry = 0, 0
259259
for font, fontsize, ccode, ox, oy in glyphs:
260260
char_id = self._get_char_id(font, ccode)
261-
if not char_id in glyph_map:
261+
if char_id not in glyph_map:
262262
font.clear()
263263
font.set_size(self.FONT_SCALE, self.DPI)
264264
glyph = font.load_char(ccode, flags=LOAD_NO_HINTING)
@@ -371,7 +371,7 @@ def get_glyphs_tex(self, prop, s, glyph_map=None,
371371

372372
char_id = self._get_char_id_ps(font, glyph)
373373

374-
if not char_id in glyph_map:
374+
if char_id not in glyph_map:
375375
font.clear()
376376
font.set_size(self.FONT_SCALE, self.DPI)
377377
if enc:

0 commit comments

Comments
 (0)
0