SpiNNakerManchester / sPyNNaker8

The PyNN 0.8 interface to sPyNNaker.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SpikeSourcePoisson produces an error while getting data after a reset if another population is recorded.

366anna opened this issue · comments

Poisson source get_data produces an error after p.reset(), if there is a second population being recorded.

import spynnaker8 as p

import numpy as np



#pre_rate = 100

n_nrn = 1



p.setup(1)



simtime = 100



pop_src2 = p.Population(n_nrn, p.SpikeSourcePoisson(rate=100), label="drive")

pop_ex = p.Population(n_nrn, p.IF_curr_exp(), label="test")

proj2 = p.Projection(pop_src2,  pop_ex,  p.OneToOneConnector(),

               synapse_type=p.StaticSynapse(weight=2.0),  receptor_type='excitatory')



pop_src2.record('spikes')

pop_ex.record('spikes')

p.run(simtime)

trains = pop_ex.get_data('spikes').segments[0].spiketrains

trains2 = pop_src2.get_data('spikes')

p.reset()

p.run(simtime)

print 2

trains = pop_ex.get_data('spikes').segments[0].spiketrains

trains2 = pop_src2.get_data('spikes')

p.end();



print "\n job done"
Traceback (most recent call last):
  File "/home/anna/SPIN/sPyNNaker8/unittests/model_tests/new_bug2.py", line 27, in <module>
    trains2 = pop_src2.get_data('spikes')
  File "/home/anna/SPIN/sPyNNaker8/spynnaker8/models/populations/population.py", line 233, in get_data
    return self._extract_neo_block(variables, clear, annotations)
  File "/home/anna/SPIN/sPyNNaker8/spynnaker8/models/recorder.py", line 65, in _extract_neo_block
    self._append_previous_segment(block, previous, variables)
  File "/home/anna/SPIN/sPyNNaker8/spynnaker8/models/recorder.py", line 228, in _append_previous_segment
    [self._population.id_to_index(atom_id) for atom_id in ids])
  File "/home/anna/SPIN/sPyNNaker/spynnaker/pyNN/models/pynn_population_common.py", line 145, in id_to_index
    self._first_id, self._last_id, id))
ValueError: id should be in the range [0,0], actually 1