8000 Style fixes. · matplotlib/matplotlib@60e5d9a · GitHub
[go: up one dir, main page]

Skip to content

Commit 60e5d9a

Browse files
committed
Style fixes.
1 parent 98490c4 commit 60e5d9a

File tree

9 files changed

+17
-16
lines changed

9 files changed

+17
-16
lines changed

lib/matplotlib/animation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,9 @@ def _adjust_frame_size(self):
315315
if self.codec == 'h264':
316316
wo, ho = self.fig.get_size_inches()
317317
w, h = adjusted_figsize(wo, ho, self.dpi, 2)
318-
if not (wo, ho) == (w, h):
318+
if (wo, ho) != (w, h):
319319
self.fig.set_size_inches(w, h, forward=True)
320-
_log.info('figure size (inches) has been adjusted '
320+
_log.info('figure size in inches has been adjusted '
321321
'from %s x %s to %s x %s', wo, ho, w, h)
322322
else:
323323
w, h = self.fig.get_size_inches()

lib/matplotlib/backends/backend_nbagg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def clearup_closed(self):
139139

140140
def remove_comm(self, comm_id):
141141
self.web_sockets = {socket for socket in self.web_sockets
142-
if not socket.comm.comm_id == comm_id}
142+
if socket.comm.comm_id != comm_id}
143143

144144

145145
class FigureCanvasNbAgg(FigureCanvasWebAggCore):

lib/matplotlib/backends/backend_ps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ def _print_figure(
917917
else:
918918
paper_width, paper_height = papersize[papertype]
919919

920-
if rcParams['ps.usedistiller'] and not papertype == 'auto':
920+
if rcParams['ps.usedistiller'] and papertype != 'auto':
921921
# distillers will improperly clip eps files if the pagesize is
922922
# too small
923923
if width > paper_width or height > paper_height:

lib/matplotlib/backends/backend_svg.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,12 @@ def start(self, tag, attrib={}, **extra):
151151
self.__write(self.__indentation[:len(self.__tags) - 1])
152152< 10000 /td>
self.__write("<%s" % tag)
153153
for k, v in sorted({**attrib, **extra}.items()):
154-
if not v == '':
154+
if v:
155155
k = escape_cdata(k)
156156
v = escape_attrib(v)
157157
self.__write(' %s="%s"' % (k, v))
158158
self.__open = 1
159-
return len(self.__tags)-1
159+
return len(self.__tags) - 1
160160

161161
def comment(self, comment):
162162
"""
@@ -229,7 +229,7 @@ def element(self, tag, text=None, attrib={}, **extra):
229229
:meth:`data`, and :meth:`end` in sequence. The *text* argument can be
230230
omitted.
231231
"""
232-
self.start(*(tag, attrib), **extra)
232+
self.start(tag, attrib, **extra)
233233
if text:
234234
self.data(text)
235235
self.end(indent=False)

lib/matplotlib/backends/backend_webagg_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ def get_javascript(cls, stream=None):
468468
for filetype, ext in sorted(FigureCanvasWebAggCore.
469469
get_supported_filetypes_grouped().
470470
items()):
471-
if not ext[0] == 'pgf': # pgf does not support BytesIO
471+
if ext[0] != 'pgf': # pgf does not support BytesIO
472472
extensions.append(ext[0])
473473
output.write("mpl.extensions = {0};\n\n".format(
474474
json.dumps(extensions)))

lib/matplotlib/dates.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,12 +1601,11 @@ class DayLocator(RRuleLocator):
16011601
"""
16021602
def __init__(self, bymonthday=None, interval=1, tz=None):
16031603
"""
1604-
Mark every day in *bymonthday*; *bymonthday* can be an int or
1605-
sequence.
1604+
Mark every day in *bymonthday*; *bymonthday* can be an int or sequence.
16061605
1607-
Default is to tick every day of the month: ``bymonthday=range(1,32)``
1606+
Default is to tick every day of the month: ``bymonthday=range(1, 32)``.
16081607
"""
1609-
if not interval == int(interval) or interval < 1:
1608+
if interval != int(interval) or interval < 1:
16101609
raise ValueError("interval must be an integer greater than 0")
16111610
if bymonthday is None:
16121611
bymonthday = range(1, 32)

lib/matplotlib/mathtext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,7 @@ def _get_glyph(self, fontname, font_class, sym, fontsize, math=True):
820820
if found_symbol:
821821
if fontname == 'it' and uniindex < 0x10000:
822822
char = chr(uniindex)
823-
if (not unicodedata.category(char)[0] == "L"
823+
if (unicodedata.category(char)[0] != "L"
824824
or unicodedata.name(char).startswith("GREEK CAPITAL")):
825825
new_fontname = 'rm'
826826

lib/matplotlib/transforms.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2899,6 +2899,8 @@ def offset_copy(trans, fig=None, x=0.0, y=0.0, units='inches'):
28992899
if units == 'points':
29002900
x /= 72.0
29012901
y /= 72.0
2902-
elif not units == 'inches':
2903-
raise ValueError('units must be dots, points, or inches')
2902+
elif units == 'inches':
2903+
pass
2904+
else:
2905+
cbook._check_in_list(['dots', 'points', 'inches'], units=units)
29042906
return trans + ScaledTranslation(x, y, fig.dpi_scale_trans)

lib/matplotlib/widgets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2231,7 +2231,7 @@ def _release(self, event):
22312231
def _onmove(self, event):
22322232
"""on motion notify event if box/line is wanted"""
22332233
# resize an existing shape
2234-
if self.active_handle and not self.active_handle == 'C':
2234+
if self.active_handle and self.active_handle != 'C':
22352235
x1, x2, y1, y2 = self._extents_on_press
22362236
if self.active_handle in ['E', 'W'] + self._corner_order:
22372237
x2 = event.xdata

0 commit comments

Comments
 (0)
0