Skip to content

Commit 27715f6

Browse files
author
David Kappel
committed
updated README
2 parents f357970 + c00ba27 commit 27715f6

File tree

13 files changed

+35
-115
lines changed

13 files changed

+35
-115
lines changed

examples/pattern_matching_showcase/experiment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
plotter = None
3030
exitcode = -1
3131

32-
if not "TEST_MODE" in sys.argv[1:]:
32+
if "TEST_MODE" not in sys.argv[1:]:
3333
# don't create plotter in test mode
3434
try:
3535
dev0 = open("/dev/null", "w")

examples/pattern_matching_showcase/python/__init__.py

Lines changed: 0 additions & 87 deletions
This file was deleted.

examples/pattern_matching_showcase/python/config.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@
2323
# GLOBAL CONFIGURATION FILE
2424
# ##########################################################
2525

26-
import os
27-
import math
2826
import logging
29-
import time
3027
import sys
3128

3229

examples/pattern_matching_showcase/python/control_node.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import music
77
import numpy as np
8-
from itertools import takewhile, dropwhile
98

109
import experiment_utils.reward as reward
1110

@@ -92,7 +91,7 @@ def _run_single_cycle(self, curr_time):
9291
self._current_pattern_id = self._next_pattern[1]
9392
try:
9493
self._next_pattern = next(self._pattern_switch_gen)
95-
except StopIteration as e:
94+
except StopIteration:
9695
self._next_pattern = None
9796

9897
if spike_rate_buffer_clear_on_phase_change:

examples/pattern_matching_showcase/python/interface.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ def configure_detail_plot(data_source):
4646
label="Output Activity (#neurons = {})".format(n_hidden_neurons))
4747

4848
c1.add_plot(plots.AnalogSignalPlot(data_source,
49-
['activity_rate_{}'.format(i) for i in range(n_patterns)], label='Activity Rates',
49+
['activity_rate_{}'.format(i) for i in range(n_patterns)],
50+
label='Activity Rates', colors=pattern_colors,
5051
legend=["Population #{}".format(i + 1) for i in range(n_patterns)],
51-
colors=pattern_colors,
5252
y_ticks=[], y_lim=(0.0, 1000.0 / hidden_neuron_properties['dead_time'])))
5353

5454
c1.add_plot(plots.AnalogSignalPlot(data_source,

examples/pattern_matching_showcase/python/network_node.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from config import *
66

77
import nest
8-
import numpy as np
98
from mpi4py import MPI
109

1110
from snn_utils.comm.music.node.nest import PyNestNode

examples/pattern_matching_showcase/python/snn_utils/comm/music/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ def buffer_event_input(self, n_buffers):
146146

147147
def pre_cycle(self, curr_sim_time):
148148
for buffers, array_buffer in self._cont_array_buffers:
149-
for i, buffer in enumerate(buffers):
150-
buffer.append_value(curr_sim_time, array_buffer[i])
149+
for i, buffer_ in enumerate(buffers):
150+
buffer_.append_value(curr_sim_time, array_buffer[i])
151151

152152
def post_cycle(self, curr_sim_time):
153153
pass
@@ -165,11 +165,11 @@ def _create_event_buffer(self):
165165
return buffer.WindowedSpikeBuffer(self._time_window)
166166

167167
def post_cycle(self, curr_sim_time):
168-
for buffer in self._all_buffers:
169-
buffer.update(curr_sim_time)
168+
for buffer_ in self._all_buffers:
169+
buffer_.update(curr_sim_time)
170170

171171

172172
class SingleStepBuffer(BaseBuffer):
173173
def post_cycle(self, curr_sim_time):
174-
for buffer in self._all_buffers:
175-
buffer.clear()
174+
for buffer_ in self._all_buffers:
175+
buffer_.clear()

examples/pattern_matching_showcase/python/snn_utils/comm/zmq/__init__.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,23 @@ def add_subscriber(self, host, port, callback, transport="tcp", prefix=u"", dese
5656
sock.setsockopt_string(zmq.SUBSCRIBE, prefix)
5757

5858
if multipart:
59-
def receive(): return sock.recv_multipart(zmq.NOBLOCK)
59+
def receive():
60+
return sock.recv_multipart(zmq.NOBLOCK)
6061
else:
61-
def receive(): return sock.recv(zmq.NOBLOCK)
62+
def receive():
63+
return sock.recv(zmq.NOBLOCK)
6264

6365
if deserialize is None:
64-
def handle(): return callback(receive())
66+
def handle():
67+
return callback(receive())
6568
else:
6669
if multipart:
67-
def handle(): return callback([elem if i == 0 else deserialize(elem)
68-
for i, elem in enumerate(receive())])
70+
def handle():
71+
return callback([elem if i == 0 else deserialize(elem)
72+
for i, elem in enumerate(receive())])
6973
else:
70-
def handle(): return callback(deserialize(receive()))
74+
def handle():
75+
return callback(deserialize(receive()))
7176

7277
self._handler[sock] = handle
7378
self._poller.register(sock, zmq.POLLIN)

examples/pattern_matching_showcase/python/snn_utils/plotter/data_provider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def extend_weight_data(self, key, df):
4949
self._weight_map[key] = df.copy()
5050
else:
5151
self._weight_map[key] = df.copy()
52-
#self._weight_map[key] = self._weight_map[key].append(df)
52+
# self._weight_map[key] = self._weight_map[key].append(df)
5353

5454
def get_cont_data(self, keys, time_window=None):
5555
return [self._map[key] for key in keys]

examples/pattern_matching_showcase/python/zmq_proxy_node.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4-
import time
5-
64
import snn_utils.comm.music
75
from config import *
86
from snn_utils.comm.music.node import PyMusicNode

0 commit comments

Comments
 (0)