8000 Merge pull request #20320 from QuLogic/fix-E265 · matplotlib/matplotlib@08f4629 · GitHub
[go: up one dir, main page]

Skip to content

Commit 08f4629

Browse files
authored
Merge pull request #20320 from QuLogic/fix-E265
Fix remaining E265 exceptions.
2 parents 9665765 + 6c80178 commit 08f4629

File tree

14 files changed

+23
-32
lines changed

14 files changed

+23
-32
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ignore =
1717
E121,E123,E126,E226,E24,E704,W503,W504,
1818
# Additional ignores:
1919
E122, E127, E131,
20-
E265, E266,
20+
E266,
2121
E305, E306,
2222
E722, E741,
2323
F841,

doc/conf.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -230,23 +230,23 @@ def _check_dependencies():
230230

231231
# There are two options for replacing |today|: either, you set today to some
232232
# non-false value, then it is used:
233-
#today = ''
233+
# today = ''
234234
# Else, today_fmt is used as the format for a strftime call.
235235
today_fmt = '%B %d, %Y'
236236

237237
# List of documents that shouldn't be included in the build.
238238
unused_docs = []
239239

240240
# If true, '()' will be appended to :func: etc. cross-reference text.
241-
#add_function_parentheses = True
241+
# add_function_parentheses = True
242242

243243
# If true, the current module name will be prepended to all description
244244
# unit titles (such as .. function::).
245-
#add_module_names = True
245+
# add_module_names = True
246246

247247
# If true, sectionauthor and moduleauthor directives will be shown in the
248248
# output. They are ignored by default.
249-
#show_authors = False
249+
# show_authors = False
250250

251251
# The name of the Pygments (syntax highlighting) style to use.
252252
pygments_style = 'sphinx'
@@ -268,16 +268,15 @@ def _check_dependencies():
268268
# The style sheet to use for HTML and HTML Help pages. A file of that name
269269
# must exist either in Sphinx' static/ path, or in one of the custom paths
270270
# given in html_static_path.
271-
#html_style = 'matplotlib.css'
272271
html_style = f'mpl.css?{SHA}'
273272

274273
# The name for this set of Sphinx documents. If None, it defaults to
275274
# "<project> v<release> documentation".
276-
#html_title = None
275+
# html_title = None
277276

278277
# The name of an image file (within the static path) to place at the top of
279278
# the sidebar.
280-
#html_logo = 'logo.png'
279+
# html_logo = 'logo.png'
281280

282281
# Add any paths that contain custom static files (such as style sheets) here,
283282
# relative to this directory. They are copied after the builtin static files,
@@ -296,7 +295,7 @@ def _check_dependencies():
296295
html_index = 'index.html'
297296

298297
# Custom sidebar templates, maps document names to template names.
299-
#html_sidebars = {}
298+
# html_sidebars = {}
300299

301300
# Custom sidebar templates, maps page names to templates.
302301
html_sidebars = {
@@ -308,11 +307,11 @@ def _check_dependencies():
308307
}
309308

310309
# If false, no module index is generated.
311-
#html_use_modindex = True
310+
# html_use_modindex = True
312311
html_domain_indices = ["py-modindex"]
313312

314313
# If true, the reST sources are included in the HTML build as _sources/<name>.
315-
#html_copy_source = True
314+
# html_copy_source = True
316315

317316
# If true, an OpenSearch description file will be output, and all pages will
318317
# contain a <link> tag referring to it.

lib/matplotlib/backends/_backend_tk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ def save_figure(self, *args):
690690
# asksaveasfilename dialog when you choose various save types
691691
# from the dropdown. Passing in the empty string seems to
692692
# work - JDH!
693-
#defaultextension = self.canvas.get_default_filetype()
693+
# defaultextension = self.canvas.get_default_filetype()
694694
defaultextension = ''
695695
initialdir = os.path.expanduser(mpl.rcParams['savefig.directory'])
696696
initialfile = self.canvas.get_default_filename()

lib/matplotlib/backends/backend_gtk3.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ def __init__(self, figure=None):
144144
style_ctx.add_class("matplotlib-canvas")
145145

146146
def destroy(self):
147-
#Gtk.DrawingArea.destroy(self)
148147
self.close_event()
149148

150149
def scroll_event(self, widget, event):

lib/matplotlib/backends/backend_template.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ def points_to_pixels(self, points):
101101
# if backend doesn't have dpi, e.g., postscript or svg
102102
return points
103103
# elif backend assumes a value for pixels_per_inch
104-
#return points/72.0 * self.dpi.get() * pixels_per_inch/72.0
104+
# return points/72.0 * self.dpi.get() * pixels_per_inch/72.0
105105
# else
106-
#return points/72.0 * self.dpi.get()
106+
# return points/72.0 * self.dpi.get()
107107

108108

109109
class GraphicsContextTemplate(GraphicsContextBase):

lib/matplotlib/backends/qt_editor/_formlayout.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ def create_datagroup_example():
554554
(datalist, "Category 2", "Category 2 comment"),
555555
(datalist, "Category 3", "Category 3 comment"))
556556

557-
#--------- datalist example
557+
# --------- datalist example
558558
datalist = create_datalist_example()
559559

560560
def apply_test(data):
@@ -563,11 +563,11 @@ def apply_test(data):
563563
comment="This is just an <b>example</b>.",
564564
apply=apply_test))
565565

566-
#--------- datagroup example
566+
# --------- datagroup example
567567
datagroup = create_datagroup_example()
568568
print("result:", fedit(datagroup, "Global title"))
569569

570-
#--------- datagroup inside a datagroup example
570+
# --------- datagroup inside a datagroup example
571571
datalist = create_datalist_example()
572572
datagroup = create_datagroup_example()
573573
print("result:", fedit(((datagroup, "Title 1", "Tab 1 comment"),

lib/matplotlib/lines.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ def __init__(self, xdata, ydata,
309309
"""
310310
super().__init__()
311311

312-
#convert sequences to numpy arrays
312+
# Convert sequences to NumPy arrays.
313313
if not np.iterable(xdata):
314314
raise RuntimeError('xdata must be a sequence')
315315
if not np.iterable(ydata):

lib/matplotlib/offsetbox.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,6 @@ def draw(self, renderer):
561561
for c in self.get_visible_children():
562562
c.draw(renderer)
563563

564-
#bbox_artist(self, renderer, fill=False, props=dict(pad=0.))
565564
self.stale = False
566565

567566
def update_frame(self, bbox, fontsize=None):
@@ -1449,9 +1448,6 @@ def contains(self, mouseevent):
14491448
if not self._check_xy(None):
14501449
return False, {}
14511450
return self.offsetbox.contains(mouseevent)
1452-
#if self.arrow_patch is not None:
1453-
# a, ainfo=self.arrow_patch.contains(event)
1454-
# t = t or a
14551451
# self.arrow_patch is currently not checked as this can be a line - JJ
14561452

14571453
def get_children(self):
@@ -1534,7 +1530,6 @@ def _update_position_xybox(self, renderer, xy_pixel):
15341530

15351531
# update patch position
15361532
bbox = self.offsetbox.get_window_extent(renderer)
1537-
#self.offsetbox.set_offset((ox0-_fw*w, oy0-_fh*h))
15381533
self.patch.set_bounds(bbox.x0, bbox.y0,
15391534
bbox.width, bbox.height)
15401535

lib/matplotlib/text.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,6 @@ def get_window_extent(self, renderer=None, dpi=None):
887887
``self.figure.dpi`` (*not* the renderer dpi); should be set e.g. if
888888
to match regions with a figure saved with a custom dpi value.
889889
"""
890-
#return _unit_box
891890
if not self.get_visible():
892891
return Bbox.unit()
893892
if dpi is None:

lib/matplotlib/tri/triinterpolate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,7 +1347,7 @@ def _cg(A, b, x0=None, tol=1.e-10, maxiter=1000):
13471347
rho = np.dot(r, w)
13481348
x = x + alpha*p
13491349
beta = rho/rhoold
1350-
#err = np.linalg.norm(A.dot(x) - b) # absolute accuracy - not used
1350+
# err = np.linalg.norm(A.dot(x) - b) # absolute accuracy - not used
13511351
k += 1
13521352
err = np.linalg.norm(A.dot(x) - b)
13531353
return x, err
@@ -1468,7 +1468,7 @@ def _pseudo_inv22sym_vectorized(M):
14681468
tr = M[rank01, 0, 0] + M[rank01, 1, 1]
14691469
tr_zeros = (np.abs(tr) < 1.e-8)
14701470
sq_tr_inv = (1.-tr_zeros) / (tr**2+tr_zeros)
1471-
#sq_tr_inv = 1. / tr**2
1471+
# sq_tr_inv = 1. / tr**2
14721472
M_inv[rank01, 0, 0] = M[rank01, 0, 0] * sq_tr_inv
14731473
M_inv[rank01, 0, 1] = M[rank01, 0, 1] * sq_tr_inv
14741474
M_inv[rank01, 1, 0] = M[rank01, 1, 0] * sq_tr_inv

lib/mpl_toolkits/axes_grid/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from . import axes_size as Size
22
from .axes_divider import Divider, SubplotDivider, make_axes_locatable
33
from .axes_grid import Grid, ImageGrid, AxesGrid
4-
#from axes_divider import make_axes_locatable
54
from matplotlib import _api
65
_api.warn_deprecated(since='2.1',
76
name='mpl_toolkits.axes_grid',

lib/mpl_toolkits/axisartist/axis_artist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ def __init__(self, axes,
648648
axes : `mpl_toolkits.axisartist.axislines.Axes`
649649
helper : `~mpl_toolkits.axisartist.axislines.AxisArtistHelper`
650650
"""
651-
#axes is also used to follow the axis attribute (tick color, etc).
651+
# axes is also used to follow the axis attribute (tick color, etc).
652652

653653
super().__init__(**kwargs)
654654

lib/mpl_toolkits/axisartist/grid_helper_curvelinear.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,11 @@ def get_tick_iterators(self, axes):
193193

194194
if self.nth_coord == 0:
195195
mask = (e0 <= yy0) & (yy0 <= e1)
196-
#xx0, yy0 = xx0[mask], yy0[mask]
196+
# xx0, yy0 = xx0[mask], yy0[mask]
197197
yy0 = yy0[mask]
198198
elif self.nth_coord == 1:
199199
mask = (e0 <= xx0) & (xx0 <= e1)
200-
#xx0, yy0 = xx0[mask], yy0[mask]
200+
# xx0, yy0 = xx0[mask], yy0[mask]
201201
xx0 = xx0[mask]
202202

203203
def transform_xy(x, y):

lib/mpl_toolkits/mplot3d/axis3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def draw(self, renderer):
347347
# the alignment point is used as the "fulcrum" for rotation.
348348
self.offsetText.set_rotation_mode('anchor')
349349

350-
#----------------------------------------------------------------------
350+
# ----------------------------------------------------------------------
351351
# Note: the following statement for determining the proper alignment of
352352
# the offset text. This was determined entirely by trial-and-error
353353
# and should not be in any way considered as "the way". There are

0 commit comments

Comments
 (0)
0