Skip to content

Commit

Permalink
Merge pull request #140 from SpiNNakerManchester/p3_fix
Browse files Browse the repository at this point in the history
divide monster
  • Loading branch information
dkfellows committed May 15, 2018
2 parents 4e16ce5 + 902606c commit d75c965
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
3 changes: 2 additions & 1 deletion p8_integration_tests/base_test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ def assert_logs_messages(
"""
seen = 0
for record in log_records:
if record.levelname == log_level and sub_message in record.msg:
if record.levelname == log_level and \
sub_message in str(record.msg):
seen += 1
if allow_more and seen > count:
return
Expand Down
5 changes: 3 additions & 2 deletions p8_integration_tests/scripts/pynnBrunnelPlot.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ def _make_plot(ts, ts1, gids, neurons, hist, hist_binwidth, grayscale, title,
heights = 1000 * n / (hist_binwidth * num_neurons)
pylab.bar(t_bins, heights, width=hist_binwidth, color=color_bar,
edgecolor=color_edge)
pylab.yticks(map(lambda x: int(x),
numpy.linspace(0.0, int(max(heights) * 1.1) + 5, 4)))
pylab.yticks(
list(map(lambda x: int(x),
numpy.linspace(0.0, int(max(heights) * 1.1) + 5, 4))))
pylab.ylabel("Rate (Hz)")
pylab.xlabel(xlabel)
pylab.xlim(xlim)
Expand Down
19 changes: 10 additions & 9 deletions p8_integration_tests/scripts/synfire_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,8 @@ def get_output_pop_gsyn_exc_list(self):
return self._recorded_gsyn_exc_list

def get_output_pop_gsyn_exc_list_numpy(self):
return map(neo_convertor.convert_gsyn_exc_list,
self._recorded_gsyn_exc_list)
return list(map(neo_convertor.convert_gsyn_exc_list,
self._recorded_gsyn_exc_list))

def get_output_pop_gsyn_exc_7(self):
return self._recorded_gsyn_exc_7
Expand All @@ -495,8 +495,8 @@ def get_output_pop_gsyn_inh_list(self):
return self._recorded_gsyn_inh_list

def get_output_pop_gsyn_inh_list_numpy(self):
return map(neo_convertor.convert_gsyn_inh_list,
self._recorded_gsyn_inh_list)
return list(map(neo_convertor.convert_gsyn_inh_list,
self._recorded_gsyn_inh_list))

def get_output_pop_gsyn_inh_neo(self):
return self._recorded_gsyn_inh_list[0]
Expand All @@ -512,8 +512,8 @@ def get_output_pop_voltage_list(self):
return self._recorded_v_list

def get_output_pop_voltage_list_numpy(self):
return map(neo_convertor.convert_v_list,
self._recorded_v_list)
return list(map(neo_convertor.convert_v_list,
self._recorded_v_list))

def get_output_pop_voltage_neo(self):
return self._recorded_v_list[0]
Expand All @@ -529,7 +529,8 @@ def get_output_pop_spikes_list(self):
return self._recorded_spikes_list

def get_output_pop_spikes_list_numpy(self):
return map(neo_convertor.convert_spikes, self._recorded_spikes_list)
return list(map(
neo_convertor.convert_spikes, self._recorded_spikes_list))

def get_output_pop_spikes_neo(self):
return self._recorded_spikes_list[0]
Expand All @@ -551,8 +552,8 @@ def get_spike_source_spikes_list(self):
return self._input_spikes_recorded_list

def get_spike_source_spikes_list_numpy(self):
return map(neo_convertor.convert_spikes,
self._input_spikes_recorded_list)
return list(map(neo_convertor.convert_spikes,
self._input_spikes_recorded_list))

def get_spike_source_spikes_neo(self):
return self._input_spikes_recorded_list[0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ def do_run(plot):
for cell in range(len(pop_stim)):
spiketimes = []
for pulse in range(pp_a):
spiketimes.append(next(rd)) # draw from the random distribution
# next method is misnamed! It is not normal next() bad PyNN
spiketimes.append(rd.next()) # draw from the random distribution
spiketimes.sort()
all_spiketimes.append(spiketimes)

Expand Down

0 comments on commit d75c965

Please sign in to comment.