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

Skip to content

Commit 55a9eb4

Browse files
authored
Merge pull request #11538 from dstansby/exmaple-pep8
TST: Re-enable pep8 on examples folder
2 parents 160d9f5 + 43f1926 commit 55a9eb4

File tree

16 files changed

+51
-55
lines changed

16 files changed

+51
-55
lines changed

examples/axisartist/demo_parasite_axes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
==================
55
66
Create a parasite axes. Such axes would share the x scale with a host axes,
7-
but show a different scale in y direction.
7+
but show a different scale in y direction.
88
99
Note that this approach uses the `~mpl_toolkits.axes_grid1.parasite_axes`\'
1010
`~.mpl_toolkits.axes_grid1.parasite_axes.HostAxes` and

examples/axisartist/demo_parasite_axes2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
1515
Note that this approach uses the `mpl_toolkits.axes_grid1.parasite_axes`\'
1616
`~mpl_toolkits.axes_grid1.parasite_axes.host_subplot` and
17-
`mpl_toolkits.axisartist.axislines.Axes`. An alternative approach using the
17+
`mpl_toolkits.axisartist.axislines.Axes`. An alternative approach using the
1818
`~mpl_toolkits.axes_grid1.parasite_axes`\'s
1919
`~.mpl_toolkits.axes_grid1.parasite_axes.HostAxes` and
2020
`~.mpl_toolkits.axes_grid1.parasite_axes.ParasiteAxes` is the

examples/images_contours_and_fields/barb_demo.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,3 @@
6565
import matplotlib
6666
matplotlib.axes.Axes.barbs
6767
matplotlib.pyplot.barbs
68-

examples/images_contours_and_fields/image_masked.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,3 @@
9191
matplotlib.pyplot.colorbar
9292
matplotlib.colors.BoundaryNorm
9393
matplotlib.colorbar.ColorbarBase.set_label
94-

examples/images_contours_and_fields/pcolor_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Generating images with :meth:`~.axes.Axes.pcolor`.
77
88
Pcolor allows you to generate 2-D image-style plots. Below we will show how
9-
to do so in Matplotlib.
9+
to do so in Matplotlib.
1010
"""
1111
import matplotlib.pyplot as plt
1212
import numpy as np

examples/images_contours_and_fields/plot_streamplot.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,3 @@
8585
matplotlib.pyplot.streamplot
8686
matplotlib.gridspec
8787
matplotlib.gridspec.GridSpec
88-

examples/images_contours_and_fields/quiver_simple_demo.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,3 @@
3636
matplotlib.pyplot.quiver
3737
matplotlib.axes.Axes.quiverkey
3838
matplotlib.pyplot.quiverkey
39-

examples/lines_bars_and_markers/marker_reference.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ def split_list(a_list):
6565
plt.show()
6666

6767

68-
6968
###############################################################################
7069
# Plot all filled markers.
7170

@@ -86,8 +85,8 @@ def split_list(a_list):
8685
#
8786
#
8887
# Use :doc:`MathText </tutorials/text/mathtext>`, to use custom marker symbols,
89-
# like e.g. ``"$\u266B$"``. For an overview over the STIX font symbols refer to the
90-
# `STIX font table <http://www.stixfonts.org/allGlyphs.html>`_.
88+
# like e.g. ``"$\u266B$"``. For an overview over the STIX font symbols refer
89+
# to the `STIX font table <http://www.stixfonts.org/allGlyphs.html>`_.
9190
# Also see the :doc:`/gallery/text_labels_and_annotations/stix_fonts_demo`.
9291

9392

examples/misc/histogram_path.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@
6565
codes = np.ones(nverts, int) * path.Path.LINETO
6666
codes[0::5] = path.Path.MOVETO
6767
codes[4::5] = path.Path.CLOSEPOLY
68-
verts[0::5,0] = left
69-
verts[0::5,1] = bottom
70-
verts[1::5,0] = left
71-
verts[1::5,1] = top
72-
verts[2::5,0] = right
73-
verts[2::5,1] = top
74-
verts[3::5,0] = right
75-
verts[3::5,1] = bottom
68+
verts[0::5, 0] = left
69+
verts[0::5, 1] = bottom
70+
verts[1::5, 0] = left
71+
verts[1::5, 1] = top
72+
verts[2::5, 0] = right
73+
verts[2::5, 1] = top
74+
verts[3::5, 0] = right
75+
verts[3::5, 1] = bottom
7676

7777
barpath = path.Path(verts, codes)
7878

@@ -95,6 +95,6 @@
9595
matplotlib.axes.Axes.add_patch
9696
matplotlib.collections.PathCollection
9797

98-
# This example shows an alternative to
98+
# This example shows an alternative to
9999
matplotlib.collections.PolyCollection
100100
matplotlib.axes.Axes.hist

examples/pyplots/align_ylabels.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import numpy as np
1111
import matplotlib.pyplot as plt
1212

13+
1314
def make_plot(axs):
1415
box = dict(facecolor='yellow', pad=5, alpha=0.2)
1516

@@ -22,7 +23,7 @@ def make_plot(axs):
2223
ax1.set_ylim(0, 2000)
2324

2425
ax3 = axs[1, 0]
25-
ax3.set_ylabel('misaligned 2',bbox=box)
26+
ax3.set_ylabel('misaligned 2', bbox=box)
2627
ax3.plot(np.random.rand(10))
2728

2829
ax2 = axs[0, 1]
@@ -35,14 +36,14 @@ def make_plot(axs):
3536
ax4.plot(np.random.rand(10))
3637
ax4.set_ylabel('aligned 2', bbox=box)
3738

38-
# Plot 1:
3939

40+
# Plot 1:
4041
fig, axs = plt.subplots(2, 2)
4142
fig.subplots_adjust(left=0.2, wspace=0.6)
4243
make_plot(axs)
4344

4445
# just align the last column of axes:
45-
fig.align_ylabels(axs[:,1])
46+
fig.align_ylabels(axs[:, 1])
4647
plt.show()
4748

4849
#############################################################################

examples/pyplots/pyplot_scales.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,4 @@
7979
matplotlib.pyplot.gca
8080
matplotlib.pyplot.yscale
8181
matplotlib.ticker.NullFormatter
82-
matplotlib.axis.Axis.set_minor_formatter
82+
matplotlib.axis.Axis.set_minor_formatter

examples/pyplots/whats_new_1_subplot3d.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
# The use of the following functions, methods, classes and modules is shown
4646
# in this example:
4747

48-
import matplotlib, mpl_toolkits
48+
import matplotlib
49+
import mpl_toolkits
4950
matplotlib.figure.Figure.add_subplot
5051
mpl_toolkits.mplot3d.axes3d.Axes3D.plot_surface
5152
mpl_toolkits.mplot3d.axes3d.Axes3D.plot_wireframe

examples/specialty_plots/sankey_links.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,3 @@ def corner(sankey):
7373
matplotlib.sankey.Sankey
7474
matplotlib.sankey.Sankey.add
7575
matplotlib.sankey.Sankey.finish
76-

examples/text_labels_and_annotations/usetex_demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
xytext=(delta / 2., 0.1), textcoords='data',
3030
arrowprops=dict(arrowstyle="<->", connectionstyle="arc3"))
3131
plt.text(0, 0.1, r'$\delta$',
32-
{'color': 'k', 'fontsize': 24, 'ha' : 'center', 'va' : 'center',
33-
'bbox' : dict(boxstyle="round", fc="w", ec="k", pad=0.2)})
32+
{'color': 'k', 'fontsize': 24, 'ha': 'center', 'va': 'center',
33+
'bbox': dict(boxstyle="round", fc="w", ec="k", pad=0.2)})
3434

3535
# Use tex in labels
3636
plt.xticks((-1, 0, 1), ('$-1$', r'$\pm 0$', '$+1$'), color='k', size=20)

examples/units/basic_units.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ def rad_fn(x, pos=None):
301301
n = int((x / np.pi) * 2.0 + 0.25)
302302
else:
303303
n = int((x / np.pi) * 2.0 - 0.25)
304-
304+
305305
if n == 0:
306306
return '0'
307307
elif n == 1:

pytest.ini

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[pytest]
2-
testpaths = lib
2+
testpaths = lib examples
33
python_files = test_*.py
44

55
markers =
@@ -99,29 +99,29 @@ pep8ignore =
9999
doc/* E302 E501
100100
tutorials/* E402 E501
101101

102-
*examples/* E501 E402
103-
*examples/misc/table_demo.py E201
104-
*examples/images_contours_and_fields/tricontour_demo.py E201
105-
*examples/images_contours_and_fields/tripcolor_demo.py E201
106-
*examples/images_contours_and_fields/triplot_demo.py E201
107-
*examples/pyplots/align_ylabels.py E231
108-
*examples/pyplots/annotate_transform.py E228 E251
109-
*examples/pyplots/annotation_basic.py E231
110-
*examples/pyplots/annotation_polar.py E231
111-
*examples/pyplots/auto_subplots_adjust.py E231 E261 E302 W391
112-
*examples/pyplots/boxplot_demo_pyplot.py E231
113-
*examples/pyplots/compound_path_demo.py E231
114-
*examples/pyplots/fig_axes_customize_simple.py E261
115-
*examples/pyplots/pyplot_formatstr.py E231
116-
*examples/pyplots/pyplot_mathtext.py E231
117-
*examples/pyplots/pyplot_simple.py E231
118-
*examples/pyplots/pyplot_two_subplots.py E302
119-
*examples/pyplots/text_commands.py E231
120-
*examples/pyplots/text_layout.py E231
121-
*examples/pyplots/whats_new_1_subplot3d.py W391
122-
*examples/pyplots/whats_new_98_4_fancy.py E225 E261 E302
123-
*examples/pyplots/whats_new_98_4_fill_between.py E225
124-
*examples/pyplots/whats_new_98_4_legend.py E228
125-
*examples/pyplots/whats_new_99_axes_grid.py E225 E231 E302 E303
126-
*examples/pyplots/whats_new_99_spines.py E231 E261
127-
*examples/shapes_and_collections/artist_reference.py E203
102+
examples/* E501 E402
103+
examples/misc/table_demo.py E201
104+
examples/images_contours_and_fields/tricontour_demo.py E201
105+
examples/images_contours_and_fields/tripcolor_demo.py E201
106+
examples/images_contours_and_fields/triplot_demo.py E201
107+
examples/pyplots/align_ylabels.py E231
108+
examples/pyplots/annotate_transform.py E228 E251
109+
examples/pyplots/annotation_basic.py E231
110+
examples/pyplots/annotation_polar.py E231
111+
examples/pyplots/auto_subplots_adjust.py E231 E261 E302 W391
112+
examples/pyplots/boxplot_demo_pyplot.py E231
113+
examples/pyplots/compound_path_demo.py E231
114+
examples/pyplots/fig_axes_customize_simple.py E261
115+
examples/pyplots/pyplot_formatstr.py E231
116+
examples/pyplots/pyplot_mathtext.py E231
117+
examples/pyplots/pyplot_simple.py E231
118+
examples/pyplots/pyplot_two_subplots.py E302
119+
examples/pyplots/text_commands.py E231
120+
examples/pyplots/text_layout.py E231
121+
examples/pyplots/whats_new_1_subplot3d.py W391
122+
examples/pyplots/whats_new_98_4_fancy.py E225 E261 E302
123+
examples/pyplots/whats_new_98_4_fill_between.py E225
124+
examples/pyplots/whats_new_98_4_legend.py E228
125+
examples/pyplots/whats_new_99_axes_grid.py E225 E231 E302 E303
126+
examples/pyplots/whats_new_99_spines.py E231 E261
127+
examples/shapes_and_collections/artist_reference.py E203

0 commit comments

Comments
 (0)