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

Skip to content

Commit 46a5603

Browse files
committed
Merge pull request #3635 from thisch/examples_pep8_e201_202_e221_222
PEP8 : fix pep8 error classes e20[12] and e22[12] in examples
2 parents 0f4a68d + ea8617d commit 46a5603

63 files changed

Lines changed: 213 additions & 213 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/color/color_cycle_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
yy = np.transpose([np.sin(x + phi) for phi in offsets])
1818

1919
plt.rc('lines', linewidth=4)
20-
fig, (ax0, ax1) = plt.subplots(nrows=2)
20+
fig, (ax0, ax1) = plt.subplots(nrows=2)
2121

2222
plt.rc('axes', color_cycle=['r', 'g', 'b', 'y'])
2323
ax0.plot(yy)

examples/event_handling/looking_glass.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
x, y = np.random.rand(2, 200)
55

66
fig, ax = plt.subplots()
7-
circ = patches.Circle( (0.5, 0.5), 0.25, alpha=0.8, fc='yellow')
7+
circ = patches.Circle((0.5, 0.5), 0.25, alpha=0.8, fc='yellow')
88
ax.add_patch(circ)
99

1010

examples/event_handling/pipong.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def __init__(self, disp, pad, field):
6262
def _reset(self,pad):
6363
self.x = pad.x + pad.xoffset
6464
if pad.y < 0:
65-
self.y = pad.y + pad.yoffset
65+
self.y = pad.y + pad.yoffset
6666
else:
6767
self.y = pad.y - pad.yoffset
6868
self.vx = pad.x - self.x
@@ -145,15 +145,15 @@ def __init__(self, ax):
145145
self.inst = True # show instructions from the beginning
146146
self.background = None
147147
self.pads = []
148-
self.pads.append( Pad(pA,0,padAy))
149-
self.pads.append( Pad(pB,padBx,padBy,'r'))
148+
self.pads.append(Pad(pA,0,padAy))
149+
self.pads.append(Pad(pB,padBx,padBy,'r'))
150150
self.pucks =[]
151151
self.i = self.ax.annotate(instructions,(.5,0.5),
152152
name='monospace',
153153
verticalalignment='center',
154154
horizontalalignment='center',
155155
multialignment='left',
156-
textcoords='axes fraction',animated=True )
156+
textcoords='axes fraction',animated=True)
157157
self.canvas.mpl_connect('key_press_event', self.key_press)
158158

159159
def draw(self, evt):

examples/misc/contour_manual.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
import matplotlib.cm as cm
77

88
# Contour lines for each level are a list/tuple of polygons.
9-
lines0 = [ [[0,0],[0,4]] ]
10-
lines1 = [ [[2,0],[1,2],[1,3]] ]
11-
lines2 = [ [[3,0],[3,2]], [[3,3],[3,4]] ] # Note two lines.
9+
lines0 = [[[0,0],[0,4]]]
10+
lines1 = [[[2,0],[1,2],[1,3]]]
11+
lines2 = [[[3,0],[3,2]], [[3,3],[3,4]]] # Note two lines.
1212

1313
# Filled contours between two levels are also a list/tuple of polygons.
1414
# Points can be ordered clockwise or anticlockwise.
15-
filled01 = [ [[0,0],[0,4],[1,3],[1,2],[2,0]] ]
16-
filled12 = [ [[2,0],[3,0],[3,2],[1,3],[1,2]], # Note two polygons.
17-
[[1,4],[3,4],[3,3]] ]
15+
filled01 = [[[0,0],[0,4],[1,3],[1,2],[2,0]]]
16+
filled12 = [[[2,0],[3,0],[3,2],[1,3],[1,2]], # Note two polygons.
17+
[[1,4],[3,4],[3,3]]]
1818

1919

2020
plt.figure()
@@ -38,8 +38,8 @@
3838
# Here a code type of 1 is a MOVETO, and 2 is a LINETO.
3939

4040
plt.figure()
41-
filled01 = [ [[0,0],[3,0],[3,3],[0,3],[1,1],[1,2],[2,2],[2,1]] ]
42-
kinds01 = [ [1,2,2,2,1,2,2,2] ]
41+
filled01 = [[[0,0],[3,0],[3,3],[0,3],[1,1],[1,2],[2,2],[2,1]]]
42+
kinds01 = [[1,2,2,2,1,2,2,2]]
4343
cs = ContourSet(plt.gca(), [0,1], [filled01], [kinds01], filled=True)
4444
cbar = plt.colorbar(cs)
4545

examples/misc/font_indexing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
coded[name] = ccode
3131
glyphd[name] = glyphind
3232

33-
code = coded['A']
33+
code = coded['A']
3434
glyph = font.load_char(code)
3535
#print glyph.bbox
3636
print(glyphd['A'], glyphd['V'], coded['A'], coded['V'])

examples/misc/rc_traits.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
doprint = True
1414
flexible_true_trait = traits.Trait(
1515
True,
16-
{ 'true': True, 't': True, 'yes': True, 'y': True, 'on': True, True: True,
16+
{'true': True, 't': True, 'yes': True, 'y': True, 'on': True, True: True,
1717
'false': False, 'f': False, 'no': False, 'n': False, 'off': False, False: False
18-
} )
19-
flexible_false_trait = traits.Trait( False, flexible_true_trait )
18+
})
19+
flexible_false_trait = traits.Trait(False, flexible_true_trait)
2020

2121
colors = {
2222
'c' : '#00bfbf',
@@ -83,7 +83,7 @@ def hex_to_rgba(ob, name, val):
8383

8484
def colorname_to_rgba(ob, name, val):
8585
hex = colors[val.lower()]
86-
r,g,b = hex2color(hex)
86+
r,g,b = hex2color(hex)
8787
return RGBA(r,g,b,1.0)
8888
colorname_to_rgba.info = 'a named color'
8989

@@ -102,7 +102,7 @@ def file_exists(ob, name, val):
102102
fh = file(val, 'r')
103103
return val
104104

105-
linestyles = ('-', '--', '-.', ':', 'steps', 'None')
105+
linestyles = ('-', '--', '-.', ':', 'steps', 'None')
106106
TICKLEFT, TICKRIGHT, TICKUP, TICKDOWN = range(4)
107107
linemarkers = (None, '.', ',', 'o', '^', 'v', '<', '>', 's',
108108
'+', 'x', 'd', 'D', '|', '_', 'h', 'H',
@@ -116,23 +116,23 @@ def file_exists(ob, name, val):
116116

117117

118118
class LineRC(traits.HasTraits):
119-
linewidth = traits.Float(0.5)
120-
linestyle = traits.Trait(*linestyles)
121-
color = Color
122-
marker = traits.Trait(*linemarkers)
119+
linewidth = traits.Float(0.5)
120+
linestyle = traits.Trait(*linestyles)
121+
color = Color
122+
marker = traits.Trait(*linemarkers)
123123
markerfacecolor = Color
124124
markeredgecolor = Color
125125
markeredgewidth = traits.Float(0.5)
126-
markersize = traits.Float(6)
127-
antialiased = flexible_true_trait
128-
data_clipping = flexible_false_trait
126+
markersize = traits.Float(6)
127+
antialiased = flexible_true_trait
128+
data_clipping = flexible_false_trait
129129

130130

131131
class PatchRC(traits.HasTraits):
132-
linewidth = traits.Float(1.0)
132+
linewidth = traits.Float(1.0)
133133
facecolor = Color
134134
edgecolor = Color
135-
antialiased = flexible_true_trait
135+
antialiased = flexible_true_trait
136136

137137
timezones = 'UTC', 'US/Central', 'ES/Eastern' # fixme: and many more
138138
backends = ('GTKAgg', 'Cairo', 'GDK', 'GTK', 'Agg',
@@ -142,11 +142,11 @@ class PatchRC(traits.HasTraits):
142142

143143
class RC(traits.HasTraits):
144144
backend = traits.Trait(*backends)
145-
interactive = flexible_false_trait
146-
toolbar = traits.Trait('toolbar2', 'classic', None)
147-
timezone = traits.Trait(*timezones)
148-
lines = traits.Trait(LineRC())
149-
patch = traits.Trait(PatchRC())
145+
interactive = flexible_false_trait
146+
toolbar = traits.Trait('toolbar2', 'classic', None)
147+
timezone = traits.Trait(*timezones)
148+
lines = traits.Trait(LineRC())
149+
patch = traits.Trait(PatchRC())
150150

151151
rc = RC()
152152
rc.lines.color = 'r'

examples/pylab_examples/anchored_artists.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def __init__(self, width, height, xdescent, ydescent,
9898

9999
# draw a horizontal bar with length of 0.1 in Data coordinate
100100
# (ax.transData) with a label underneath.
101-
asb = AnchoredSizeBar(ax.transData,
101+
asb = AnchoredSizeBar(ax.transData,
102102
0.1,
103103
r"1$^{\prime}$",
104104
loc=8,

examples/pylab_examples/anscombe.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
from pylab import *
1313

14-
x = array([10, 8, 13, 9, 11, 14, 6, 4, 12, 7, 5])
14+
x = array([10, 8, 13, 9, 11, 14, 6, 4, 12, 7, 5])
1515
y1 = array([8.04, 6.95, 7.58, 8.81, 8.33, 9.96, 7.24, 4.26, 10.84, 4.82, 5.68])
1616
y2 = array([9.14, 8.14, 8.74, 8.77, 9.26, 8.10, 6.13, 3.10, 9.13, 7.26, 4.74])
1717
y3 = array([7.46, 6.77, 12.74, 7.11, 7.81, 8.84, 6.08, 5.39, 8.15, 6.42, 5.73])
@@ -23,7 +23,7 @@ def fit(x):
2323
return 3+0.5*x
2424

2525

26-
xfit = array( [amin(x), amax(x) ] )
26+
xfit = array([amin(x), amax(x)])
2727

2828
subplot(221)
2929
plot(x,y1,'ks', xfit, fit(xfit), 'r-', lw=2)

examples/pylab_examples/axes_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
# the main axes is subplot(111) by default
1313
plot(t, s)
14-
axis([0, 1, 1.1*amin(s), 2*amax(s) ])
14+
axis([0, 1, 1.1*amin(s), 2*amax(s)])
1515
xlabel('time (s)')
1616
ylabel('current (nA)')
1717
title('Gaussian colored noise')

examples/pylab_examples/axis_equal_demo.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@
77
an = linspace(0,2*pi,100)
88

99
subplot(221)
10-
plot( 3*cos(an), 3*sin(an) )
10+
plot(3*cos(an), 3*sin(an))
1111
title('not equal, looks like ellipse',fontsize=10)
1212

1313
subplot(222)
14-
plot( 3*cos(an), 3*sin(an) )
14+
plot(3*cos(an), 3*sin(an))
1515
axis('equal')
1616
title('equal, looks like circle',fontsize=10)
1717

1818
subplot(223)
19-
plot( 3*cos(an), 3*sin(an) )
19+
plot(3*cos(an), 3*sin(an))
2020
axis('equal')
2121
axis([-3,3,-3,3])
2222
title('looks like circle, even after changing limits',fontsize=10)
2323

2424
subplot(224)
25-
plot( 3*cos(an), 3*sin(an) )
25+
plot(3*cos(an), 3*sin(an))
2626
axis('equal')
2727
axis([-3,3,-3,3])
2828
plot([0,4],[0,4])

0 commit comments

Comments
 (0)