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

Skip to content

Commit 1a40221

Browse files
authored
Merge pull request #12026 from anntzer/style
whitespace(-mostly) style cleanup.
2 parents 256e49e + 4633cbd commit 1a40221

29 files changed

Lines changed: 234 additions & 371 deletions

.flake8

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -31,50 +31,49 @@ per-file-ignores =
3131
matplotlib/_cm.py: E202, E203, E302
3232
matplotlib/_mathtext_data.py: E203, E261
3333
matplotlib/backend_bases.py: E225
34-
matplotlib/backends/_backend_tk.py: E203, E222, E225, E231, E271, E301, E303, E401, E501, E701
35-
matplotlib/backends/backend_agg.py: E261, E302, E701
36-
matplotlib/backends/backend_cairo.py: E203, E221, E261, E303, E402
37-
matplotlib/backends/backend_gtk3.py: E203, E221, E222, E225, E251, E261, E501
34+
matplotlib/backends/_backend_tk.py: E203, E222, E225, E231, E271, E301, E401, E501, E701
35+
matplotlib/backends/backend_agg.py: E302, E701
36+
matplotlib/backends/backend_cairo.py: E203, E221, E402
37+
matplotlib/backends/backend_gtk3.py: E203, E221, E222, E225, E251, E501
3838
matplotlib/backends/backend_pgf.py: E303, E731
3939
matplotlib/backends/qt_editor/formlayout.py: E301, E501
40-
matplotlib/backends/tkagg.py: E231, E302, E701
41-
matplotlib/font_manager.py: E203, E221, E251, E261, E262, E302, E501
42-
matplotlib/fontconfig_pattern.py: E201, E203, E221, E222, E225, E302
40+
matplotlib/backends/tkagg.py: E231, E701
41+
matplotlib/font_manager.py: E203, E221, E251, E501
42+
matplotlib/fontconfig_pattern.py: E201, E203, E221, E222, E225
4343
matplotlib/mathtext.py: E201, E202, E203, E211, E221, E222, E225, E251, E301, E402
44-
matplotlib/projections/geo.py: E203, E221, E231, E261, E502
44+
matplotlib/projections/geo.py: E203, E221, E231, E502
4545
matplotlib/pylab.py: E501
4646
matplotlib/pyplot.py: E302, E701
47-
matplotlib/rcsetup.py: E203, E225, E261, E302, E501
47+
matplotlib/rcsetup.py: E203, E225, E501
4848
matplotlib/sphinxext/plot_directive.py: E402
4949
matplotlib/tests/test_image.py: E231
5050
matplotlib/tests/test_mathtext.py: E501
5151
matplotlib/transforms.py: E201, E202, E203, E501
5252
matplotlib/tri/triinterpolate.py: E201, E221
5353
matplotlib/type1font.py: E731
5454

55-
mpl_toolkits/__init__.py: E261
5655
mpl_toolkits/axes_grid/axes_rgb.py: E501
5756
mpl_toolkits/axes_grid1/axes_divider.py: E402, E501
5857
mpl_toolkits/axes_grid1/axes_grid.py: E225
5958
mpl_toolkits/axes_grid1/axes_rgb.py: E231
60-
mpl_toolkits/axes_grid1/axes_size.py: E261, E501
61-
mpl_toolkits/axes_grid1/colorbar.py: E225, E231, E261, E262, E302, E303, E501, E701
59+
mpl_toolkits/axes_grid1/axes_size.py: E501
60+
mpl_toolkits/axes_grid1/colorbar.py: E225, E231, E501
6261
mpl_toolkits/axes_grid1/inset_locator.py: E501
6362
mpl_toolkits/axes_grid1/mpl_axes.py: E501
64-
mpl_toolkits/axisartist/angle_helper.py: E201, E203, E221, E222, E225, E231, E251, E261, E262, E302, E303, E501
65-
mpl_toolkits/axisartist/axis_artist.py: E201, E202, E221, E225, E228, E231, E251, E261, E262, E302, E303, E402, E501, E701
66-
mpl_toolkits/axisartist/axisline_style.py: E231, E261, E262, E302, E303
67-
mpl_toolkits/axisartist/axislines.py: E225, E231, E261, E303, E501
68-
mpl_toolkits/axisartist/clip_path.py: E225, E302, E303, E501
69-
mpl_toolkits/axisartist/floating_axes.py: E225, E231, E261, E262, E302, E303, E402, E501
70-
mpl_toolkits/axisartist/grid_finder.py: E231, E261, E302, E303, E402
71-
mpl_toolkits/axisartist/grid_helper_curvelinear.py: E225, E231, E261, E262, E271, E302, E303, E501
63+
mpl_toolkits/axisartist/angle_helper.py: E201, E203, E221, E222, E225, E231, E251, E501
64+
mpl_toolkits/axisartist/axis_artist.py: E201, E202, E221, E225, E228, E231, E251, E501, E701
65+
mpl_toolkits/axisartist/axisline_style.py: E231
66+
mpl_toolkits/axisartist/axislines.py: E225, E231, E501
67+
mpl_toolkits/axisartist/clip_path.py: E225, E501
68+
mpl_toolkits/axisartist/floating_axes.py: E225, E231, E402, E501
69+
mpl_toolkits/axisartist/grid_finder.py: E231
70+
mpl_toolkits/axisartist/grid_helper_curvelinear.py: E225, E231, E501
7271
mpl_toolkits/mplot3d/art3d.py: E203, E222, E225, E231
7372
mpl_toolkits/mplot3d/axes3d.py: E203, E231, E402, E501, E701
74-
mpl_toolkits/mplot3d/axis3d.py: E231, E302
75-
mpl_toolkits/mplot3d/proj3d.py: E231, E302, E303
73+
mpl_toolkits/mplot3d/axis3d.py: E231
74+
mpl_toolkits/mplot3d/proj3d.py: E231
7675
mpl_toolkits/tests/test_axes_grid1.py: E201, E202
77-
mpl_toolkits/tests/test_mplot3d.py: E231, E302
76+
mpl_toolkits/tests/test_mplot3d.py: E231
7877

7978
doc/conf.py: E402, E501
8079
doc/sphinxext/github.py: E302, E501
@@ -188,11 +187,11 @@ per-file-ignores =
188187
examples/pyplots/annotate_transform.py: E228, E251, E402, E501
189188
examples/pyplots/annotation_basic.py: E402
190189
examples/pyplots/annotation_polar.py: E231, E402
191-
examples/pyplots/auto_subplots_adjust.py: E231, E261, E302, E402
190+
examples/pyplots/auto_subplots_adjust.py: E231, E302, E402
192191
examples/pyplots/boxplot_demo_pyplot.py: E231, E402
193192
examples/pyplots/compound_path_demo.py: E231
194193
examples/pyplots/dollar_ticks.py: E402
195-
examples/pyplots/fig_axes_customize_simple.py: E261, E402
194+
examples/pyplots/fig_axes_customize_simple.py: E402
196195
examples/pyplots/fig_axes_labels_simple.py: E402
197196
examples/pyplots/fig_x.py: E402
198197
examples/pyplots/pyplot_formatstr.py: E231, E402
@@ -206,12 +205,12 @@ per-file-ignores =
206205
examples/pyplots/text_commands.py: E231, E402
207206
examples/pyplots/text_layout.py: E231, E402
208207
examples/pyplots/whats_new_1_subplot3d.py: E402
209-
examples/pyplots/whats_new_98_4_fancy.py: E225, E261, E302, E402
208+
examples/pyplots/whats_new_98_4_fancy.py: E302, E402
210209
examples/pyplots/whats_new_98_4_fill_between.py: E225, E402
211210
examples/pyplots/whats_new_98_4_legend.py: E228, E402
212211
examples/pyplots/whats_new_99_axes_grid.py: E402
213212
examples/pyplots/whats_new_99_mplot3d.py: E402
214-
examples/pyplots/whats_new_99_spines.py: E231, E261, E402
213+
examples/pyplots/whats_new_99_spines.py: E231, E402
215214
examples/recipes/placing_text_boxes.py: E501
216215
examples/scales/power_norm.py: E402
217216
examples/shapes_and_collections/artist_reference.py: E402

examples/pyplots/auto_subplots_adjust.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def on_draw(event):
3232
bbox = mtransforms.Bbox.union(bboxes)
3333
if fig.subplotpars.left < bbox.width:
3434
# we need to move it over
35-
fig.subplots_adjust(left=1.1*bbox.width) # pad a little
35+
fig.subplots_adjust(left=1.1*bbox.width) # pad a little
3636
fig.canvas.draw()
3737
return False
3838

examples/pyplots/fig_axes_customize_simple.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# ``plt.figure`` creates a ```matplotlib.figure.Figure`` instance
1313

1414
fig = plt.figure()
15-
rect = fig.patch # a rectangle instance
15+
rect = fig.patch # a rectangle instance
1616
rect.set_facecolor('lightgoldenrodyellow')
1717

1818
ax1 = fig.add_axes([0.1, 0.3, 0.4, 0.4])

examples/pyplots/whats_new_98_4_fancy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ def make_arrowstyles(ax):
2929
ax.set_ylim(0, figheight)
3030

3131
for i, (stylename, styleclass) in enumerate(sorted(styles.items())):
32-
y = (float(len(styles)) -0.25 - i) # /figheight
32+
y = (float(len(styles)) - 0.25 - i) # /figheight
3333
p = mpatch.Circle((3.2, y), 0.2, fc="w")
3434
ax.add_patch(p)
3535

3636
ax.annotate(stylename, (3.2, y),
3737
(2., y),
38-
#xycoords="figure fraction", textcoords="figure fraction",
38+
# xycoords="figure fraction", textcoords="figure fraction",
3939
ha="right", va="center",
4040
size=fontsize,
4141
arrowprops=dict(arrowstyle=stylename,

examples/pyplots/whats_new_99_spines.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
def adjust_spines(ax,spines):
1212
for loc, spine in ax.spines.items():
1313
if loc in spines:
14-
spine.set_position(('outward',10)) # outward by 10 points
14+
spine.set_position(('outward', 10)) # outward by 10 points
1515
else:
16-
spine.set_color('none') # don't draw spine
16+
spine.set_color('none') # don't draw spine
1717

1818
# turn off ticks where there is no spine
1919
if 'left' in spines:

lib/matplotlib/backends/_backend_tk.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ def resize(self, event):
258258
hinch = height/dpival
259259
self.figure.set_size_inches(winch, hinch, forward=False)
260260

261-
262261
self._tkcanvas.delete(self._tkphoto)
263262
self._tkphoto = Tk.PhotoImage(
264263
master=self._tkcanvas, width=int(width), height=int(height))

lib/matplotlib/backends/backend_agg.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,7 @@ def tostring_rgba_minimized(self):
118118
return np.array(region), extents
119119

120120
def draw_path(self, gc, path, transform, rgbFace=None):
121-
"""
122-
Draw the path
123-
"""
124-
nmax = rcParams['agg.path.chunksize'] # here at least for testing
121+
nmax = rcParams['agg.path.chunksize'] # here at least for testing
125122
npts = path.vertices.shape[0]
126123

127124
if (nmax > 100 and npts > nmax and path.should_simplify and

lib/matplotlib/backends/backend_cairo.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ class RendererCairo(RendererBase):
189189
'oblique' : cairo.FONT_SLANT_OBLIQUE,
190190
}
191191

192-
193192
def __init__(self, dpi):
194193
self.dpi = dpi
195194
self.gc = GraphicsContextCairo(renderer=self)
@@ -436,7 +435,7 @@ def get_text_width_height_descent(self, s, prop, ismath):
436435
def new_gc(self):
437436
self.gc.ctx.save()
438437
self.gc._alpha = 1
439-
self.gc._forced_alpha = False # if True, _alpha overrides A from RGBA
438+
self.gc._forced_alpha = False # if True, _alpha overrides A from RGBA
440439
return self.gc
441440

442441
def points_to_pixels(self, points):

lib/matplotlib/backends/backend_gtk3.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def configure_event(self, widget, event):
267267
return
268268
w, h = event.width, event.height
269269
if w < 3 or h < 3:
270-
return # empty fig
270+
return # empty fig
271271
# resize the figure (in inches)
272272
dpi = self.figure.dpi
273273
self.figure.set_size_inches(w / dpi, h / dpi, forward=False)
@@ -947,7 +947,7 @@ def trigger(self, *args, **kwargs):
947947

948948

949949
def error_msg_gtk(msg, parent=None):
950-
if parent is not None: # find the toplevel Gtk.Window
950+
if parent is not None: # find the toplevel Gtk.Window
951951
parent = parent.get_toplevel()
952952
if not parent.is_toplevel():
953953
parent = None

lib/matplotlib/backends/tkagg.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def blit(photoimage, aggimage, bbox=None, colormode=1):
3535
tk.call("PyAggImagePhoto", photoimage,
3636
dataptr, colormode, bboxptr)
3737

38+
3839
def test(aggimage):
3940
r = Tk.Tk()
4041
c = Tk.Canvas(r, width=aggimage.width, height=aggimage.height)

0 commit comments

Comments
 (0)