Skip to content

Commit 01162da

Browse files
committed
flake8
1 parent 12e9b2a commit 01162da

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

examples/pendulum/pendulum_follow_c_vis.py

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def make_kernel_circle(r, k_sz, weight, kernel):
4141
kernel[var + dx, var + dy] = weight
4242

4343

44-
4544
def read_csv_line(f):
4645
line = f.readline()
4746
if not f:

examples/pendulum/pendulum_follow_python_vis.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ def recv_conv(label, time, spikes):
161161

162162

163163
conn = p.external_devices.SpynnakerLiveSpikesConnection(
164-
receive_labels=[SEND_POP_LABEL, POP_LABEL], send_labels=[SEND_POP_LABEL], local_port=None)
164+
receive_labels=[SEND_POP_LABEL, POP_LABEL], send_labels=[SEND_POP_LABEL],
165+
local_port=None)
165166
conn.add_receive_callback(SEND_POP_LABEL, recv)
166167
conn.add_receive_callback(POP_LABEL, recv_conv)
167168
conn.add_start_callback(

examples/pendulum/spike_filter.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ def make_kernel_circle(r, k_sz, weight, kernel):
3939
kernel[var + dx, var + dy] = weight
4040

4141

42-
4342
def read_csv_line(f):
4443
line = f.readline()
4544
if not f:
@@ -55,7 +54,7 @@ def send_spikes(width, height, min_x, min_y, run_time, label, connection):
5554
start_time = None
5655
max_x = min_x + width
5756
max_y = min_y + height
58-
y_shift = get_n_bits(width)
57+
# y_shift = get_n_bits(width)
5958
with open("spikes.csv") as f:
6059
first_time = -1
6160
line = read_csv_line(f)
@@ -71,9 +70,9 @@ def send_spikes(width, height, min_x, min_y, run_time, label, connection):
7170
line = next_line
7271

7372
filtered_lines = [
74-
l for l in same_time_lines
75-
if (l.x >= min_x and l.x < max_x and l.y >= min_y and
76-
l.y < max_y)]
73+
line for line in same_time_lines
74+
if (line.x >= min_x and line.x < max_x and
75+
line.y >= min_y and line.y < max_y)]
7776

7877
if not filtered_lines:
7978
continue
@@ -161,11 +160,13 @@ def recv_conv(label, time, spikes):
161160

162161

163162
conn = p.external_devices.SpynnakerLiveSpikesConnection(
164-
receive_labels=[SEND_POP_LABEL, POP_LABEL], send_labels=[SEND_POP_LABEL], local_port=None)
163+
receive_labels=[SEND_POP_LABEL, POP_LABEL], send_labels=[SEND_POP_LABEL],
164+
local_port=None)
165165
conn.add_receive_callback(SEND_POP_LABEL, recv)
166166
conn.add_receive_callback(POP_LABEL, recv_conv)
167167
conn.add_start_callback(
168-
SEND_POP_LABEL, partial(send_spikes, WIDTH, HEIGHT, MIN_X, MIN_Y, RUN_TIME / 1000.0))
168+
SEND_POP_LABEL, partial(
169+
send_spikes, WIDTH, HEIGHT, MIN_X, MIN_Y, RUN_TIME / 1000.0))
169170

170171

171172
p.setup(1.0)

0 commit comments

Comments
 (0)