Skip to content

Commit c2839ad

Browse files
committed
remove empty lines after class decl
Signed-off-by: Thomas Hisch <t.hisch@gmail.com>
1 parent 36030da commit c2839ad

13 files changed

+29
-29
lines changed

examples/animation/animate_decay.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def data_gen():
99
while cnt < 1000:
1010
cnt += 1
1111
t += 0.05
12-
yield t, np.sin(2*np.pi*t) * np.exp(-t/10.)
12+
yield t, np.sin(2 * np.pi * t) * np.exp(-t / 10.)
1313
data_gen.t = 0
1414

1515
fig, ax = plt.subplots()
@@ -28,7 +28,7 @@ def run(data):
2828
xmin, xmax = ax.get_xlim()
2929

3030
if t >= xmax:
31-
ax.set_xlim(xmin, 2*xmax)
31+
ax.set_xlim(xmin, 2 * xmax)
3232
ax.figure.canvas.draw()
3333
line.set_data(xdata, ydata)
3434

examples/animation/basic_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def update_line(num, data, line):
1717
plt.title('test')
1818
line_ani = animation.FuncAnimation(fig1, update_line, 25, fargs=(data, l),
1919
interval=50, blit=True)
20-
#line_ani.save('lines.mp4')
20+
# line_ani.save('lines.mp4')
2121

2222
fig2 = plt.figure()
2323

examples/animation/bayes_update.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77

88
class UpdateDist(object):
9+
910
def __init__(self, ax, prob=0.5):
1011
self.success = 0
1112
self.prob = prob

examples/animation/double_pendulum_animated.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ def derivs(state, t):
1919
dydx = np.zeros_like(state)
2020
dydx[0] = state[1]
2121

22-
del_ = state[2]-state[0]
23-
den1 = (M1+M2)*L1 - M2*L1*cos(del_)*cos(del_)
24-
dydx[1] = (M2*L1*state[1]*state[1]*sin(del_)*cos(del_)
25-
+ M2*G*sin(state[2])*cos(del_)
26-
+ M2*L2*state[3]*state[3]*sin(del_)
27-
- (M1+M2)*G*sin(state[0]))/den1
22+
del_ = state[2] - state[0]
23+
den1 = (M1 + M2) * L1 - M2 * L1 * cos(del_) * cos(del_)
24+
dydx[1] = (M2 * L1 * state[1] * state[1] * sin(del_) * cos(del_)
25+
+ M2 * G * sin(state[2]) * cos(del_)
26+
+ M2 * L2 * state[3] * state[3] * sin(del_)
27+
- (M1 + M2) * G * sin(state[0])) / den1
2828

2929
dydx[2] = state[3]
3030

31-
den2 = (L2/L1)*den1
32-
dydx[3] = (-M2*L2*state[3]*state[3]*sin(del_)*cos(del_)
33-
+ (M1+M2)*G*sin(state[0])*cos(del_)
34-
- (M1+M2)*L1*state[1]*state[1]*sin(del_)
35-
- (M1+M2)*G*sin(state[2]))/den2
31+
den2 = (L2 / L1) * den1
32+
dydx[3] = (-M2 * L2 * state[3] * state[3] * sin(del_) * cos(del_)
33+
+ (M1 + M2) * G * sin(state[0]) * cos(del_)
34+
- (M1 + M2) * L1 * state[1] * state[1] * sin(del_)
35+
- (M1 + M2) * G * sin(state[2])) / den2
3636

3737
return dydx
3838

@@ -53,11 +53,11 @@ def derivs(state, t):
5353
# integrate your ODE using scipy.integrate.
5454
y = integrate.odeint(derivs, state, t)
5555

56-
x1 = L1*sin(y[:, 0])
57-
y1 = -L1*cos(y[:, 0])
56+
x1 = L1 * sin(y[:, 0])
57+
y1 = -L1 * cos(y[:, 0])
5858

59-
x2 = L2*sin(y[:, 2]) + x1
60-
y2 = -L2*cos(y[:, 2]) + y1
59+
x2 = L2 * sin(y[:, 2]) + x1
60+
y2 = -L2 * cos(y[:, 2]) + y1
6161

6262
fig = plt.figure()
6363
ax = fig.add_subplot(111, autoscale_on=False, xlim=(-2, 2), ylim=(-2, 2))
@@ -79,7 +79,7 @@ def animate(i):
7979
thisy = [0, y1[i], y2[i]]
8080

8181
line.set_data(thisx, thisy)
82-
time_text.set_text(time_template % (i*dt))
82+
time_text.set_text(time_template % (i * dt))
8383
return line, time_text
8484

8585
ani = animation.FuncAnimation(fig, animate, np.arange(1, len(y)),

examples/animation/dynamic_image2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def f(x, y):
2727
ani = animation.ArtistAnimation(fig, ims, interval=50, blit=True,
2828
repeat_delay=1000)
2929

30-
#ani.save('dynamic_images.mp4')
30+
# ani.save('dynamic_images.mp4')
3131

3232

3333
plt.show()

examples/animation/histogram.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
# for each rect: 1 for the MOVETO, 3 for the LINETO, 1 for the
2929
# CLOSEPOLY; the vert for the closepoly is ignored but we still need
3030
# it to keep the codes aligned with the vertices
31-
nverts = nrects*(1 + 3 + 1)
31+
nverts = nrects * (1 + 3 + 1)
3232
verts = np.zeros((nverts, 2))
3333
codes = np.ones(nverts, int) * path.Path.LINETO
3434
codes[0::5] = path.Path.MOVETO

examples/animation/rain.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def update(frame_number):
4141
current_index = frame_number % n_drops
4242

4343
# Make all colors more transparent as time progresses.
44-
rain_drops['color'][:, 3] -= 1.0/len(rain_drops)
44+
rain_drops['color'][:, 3] -= 1.0 / len(rain_drops)
4545
rain_drops['color'][:, 3] = np.clip(rain_drops['color'][:, 3], 0, 1)
4646

4747
# Make all circles bigger.

examples/animation/simple_3danim.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def Gen_RandLine(length, dims=2):
2222
# subtraction by 0.5 is to change the range to [-0.5, 0.5]
2323
# to allow a line to move backwards.
2424
step = ((np.random.rand(dims) - 0.5) * 0.1)
25-
lineData[:, index] = lineData[:, index-1] + step
25+
lineData[:, index] = lineData[:, index - 1] + step
2626

2727
return lineData
2828

examples/animation/simple_anim.py

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

88
fig, ax = plt.subplots()
99

10-
x = np.arange(0, 2*np.pi, 0.01)
10+
x = np.arange(0, 2 * np.pi, 0.01)
1111
line, = ax.plot(x, np.sin(x))
1212

1313

1414
def animate(i):
15-
line.set_ydata(np.sin(x + i/10.0)) # update the data
15+
line.set_ydata(np.sin(x + i / 10.0)) # update the data
1616
return line,
1717

1818

examples/animation/strip_chart_demo.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010

1111
class Scope:
12+
1213
def __init__(self, ax, maxt=2, dt=0.02):
1314
self.ax = ax
1415
self.dt = dt

examples/animation/subplots.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# total of 9 lines that need to be changed for the animation as well as 3
1111
# subplots that need initial set up.
1212
class SubplotAnimation(animation.TimedAnimation):
13+
1314
def __init__(self):
1415
fig = plt.figure()
1516
ax1 = fig.add_subplot(1, 2, 1)
@@ -93,5 +94,5 @@ def _init_draw(self):
9394
l.set_data([], [])
9495

9596
ani = SubplotAnimation()
96-
#ani.save('test_sub.mp4')
97+
# ani.save('test_sub.mp4')
9798
plt.show()

examples/event_handling/pipong.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ def _speedlimit(self):
119119

120120

121121
class Game(object):
122-
123122
def __init__(self, ax):
124123
# create the initial line
125124
self.ax = ax

examples/misc/multiprocess.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020

2121
class ProcessPlotter(object):
22-
2322
def __init__(self):
2423
self.x = []
2524
self.y = []
@@ -28,7 +27,6 @@ def terminate(self):
2827
plt.close('all')
2928

3029
def poll_draw(self):
31-
3230
def call_back():
3331
while 1:
3432
if not self.pipe.poll():

0 commit comments

Comments
 (0)