Skip to content

Commit b959c79

Browse files
committed
pep8 fix e702,e703
1 parent 0130bb9 commit b959c79

File tree

11 files changed

+27
-18
lines changed

11 files changed

+27
-18
lines changed

examples/event_handling/pipong.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ def update(self, pads):
8282
# probably cleaner with something like...if not self.field.contains(self.x, self.y):
8383
if self.x < 0 + fudge:
8484
#print("player A loses")
85-
pads[1].score += 1;
85+
pads[1].score += 1
8686
self._reset(pads[0])
8787
return True
8888
if self.x > 7 - fudge:
8989
#print("player B loses")
90-
pads[0].score += 1;
90+
pads[0].score += 1
9191
self._reset(pads[1])
9292
return True
9393
if self.y < -1 + fudge or self.y > 1 - fudge:

examples/lines_bars_and_markers/barh_demo.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
"""
22
Simple demo of a horizontal bar chart.
33
"""
4-
import matplotlib.pyplot as plt; plt.rcdefaults()
4+
import matplotlib.pyplot as plt
5+
plt.rcdefaults()
56
import numpy as np
67
import matplotlib.pyplot as plt
78

examples/pylab_examples/centered_ticklabels.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020

2121
# load some financial data; apple's stock price
2222
fh = cbook.get_sample_data('aapl.npy.gz')
23-
r = np.load(fh); fh.close()
23+
r = np.load(fh)
24+
fh.close()
2425
r = r[-250:] # get the last 250 days
2526

2627
fig, ax = plt.subplots()

examples/pylab_examples/finance_work2.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
fh = finance.fetch_historical_yahoo(ticker, startdate, enddate)
1818
# a numpy record array with fields: date, open, high, low, close, volume, adj_close)
1919

20-
r = mlab.csv2rec(fh); fh.close()
20+
r = mlab.csv2rec(fh)
21+
fh.close()
2122
r.sort()
2223

2324

examples/pylab_examples/image_origin.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
"""
88
from pylab import *
99

10-
x = arange(100.0); x.shape = 10, 10
10+
x = arange(100.0)
11+
x.shape = 10, 10
1112

12-
interp = 'bilinear';
13+
interp = 'bilinear'
1314
#interp = 'nearest';
1415
lim = -2, 11, -2, 6
1516
subplot(211, axisbg='g')

examples/pylab_examples/interp_demo.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
from numpy import pi, sin, linspace
33
from matplotlib.mlab import stineman_interp
44

5-
x = linspace(0, 2*pi, 20);
6-
y = sin(x); yp = None
7-
xi = linspace(x[0], x[-1], 100);
8-
yi = stineman_interp(xi, x, y, yp);
5+
x = linspace(0, 2*pi, 20)
6+
y = sin(x)
7+
yp = None
8+
xi = linspace(x[0], x[-1], 100)
9+
yi = stineman_interp(xi, x, y, yp)
910

1011
fig, ax = plt.subplots()
1112
ax.plot(x, y, 'ro', xi, yi, '-b.')

examples/pylab_examples/layer_images.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ def func3(x, y):
2828
extent = xmin, xmax, ymin, ymax
2929
fig = plt.figure(frameon=False)
3030

31-
Z1 = array(([0, 1]*4 + [1, 0]*4)*4); Z1.shape = 8, 8 # chessboard
31+
Z1 = array(([0, 1]*4 + [1, 0]*4)*4)
32+
Z1.shape = 8, 8 # chessboard
3233
im1 = imshow(Z1, cmap=cm.gray, interpolation='nearest',
3334
extent=extent)
3435
hold(True)

examples/pylab_examples/quadmesh_demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
n = 12
1515
x = np.linspace(-1.5, 1.5, n)
1616
y = np.linspace(-1.5, 1.5, n*2)
17-
X, Y = np.meshgrid(x, y);
17+
X, Y = np.meshgrid(x, y)
1818
Qx = np.cos(Y) - np.cos(X)
1919
Qz = np.sin(Y) + np.sin(X)
2020
Qx = (Qx + 1.1)
21-
Z = np.sqrt(X**2 + Y**2)/5;
21+
Z = np.sqrt(X**2 + Y**2)/5
2222
Z = (Z - Z.min()) / (Z.max() - Z.min())
2323

2424
# The color array can include masked values:

examples/pylab_examples/zorder_demo.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"""
2222

2323
from pylab import *
24-
x = rand(20); y = rand(20)
24+
x = rand(20)
25+
y = rand(20)
2526

2627
subplot(211)
2728
plot(x, y, 'r', lw=3)

examples/shapes_and_collections/artist_reference.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
Copyright (c) 2010, Bartosz Telenczuk
99
BSD License
1010
"""
11-
import matplotlib.pyplot as plt; plt.rcdefaults()
11+
import matplotlib.pyplot as plt
12+
plt.rcdefaults()
1213

1314
import numpy as np
1415
import matplotlib.pyplot as plt

examples/user_interfaces/pylab_with_gtk.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
# now let's add a button to the toolbar
2222
import gtk
23-
next = 8; # where to insert this in the mpl toolbar
23+
next = 8 # where to insert this in the mpl toolbar
2424
button = gtk.Button('Click me')
2525
button.show()
2626

@@ -36,7 +36,8 @@ def clicked(button):
3636
'Click me for fun and profit')
3737

3838
toolitem.add(button)
39-
toolbar.insert(toolitem, next); next += 1
39+
toolbar.insert(toolitem, next)
40+
next += 1
4041

4142
# now let's add a widget to the vbox
4243
label = gtk.Label()

0 commit comments

Comments
 (0)