Ticket #109 (closed defect: fixed)

Opened 2 months ago

Last modified 2 months ago

Spikes from neuron.SpikeSourceArray are not recorded in some cases

Reported by: mschmucker Assigned to: apdavison
Priority: major Milestone: Release 0.5.0
Component: neuron Version: trunk
Keywords: Cc:

Description

Spikes from a Population of SpikeSourceArray? are not retrieved by getSpikes() if they are set after creation of the population. The following piece of code illustrates this:

from pyNN.neuron import * 
setup(quit_on_end = False)
stim1 = Population(1, SpikeSourceArray, cellparams = {'spike_times': [10.,20.,30.,40.]})
stim2 = Population(1, SpikeSourceArray)
stim2.set('spike_times', [10.,20.,30.,40.])

stim1.record()
stim2.record()

run(100.)
end()

print 'stim1: ', stim1.getSpikes()
print 'stim2: ', stim2.getSpikes()

Output:

stim1:  [[  0.  10.]
 [  0.  20.]
 [  0.  30.]
 [  0.  40.]]
stim2:  []

Spikes from the stim1 are recorded, but not from stim2. The only difference is that for stim1, spike_times are set when creating the Population, while for stim2 they are set manually using Population.set().

Note that both Populations produce spikes as desired. They are just not recorded when using Population.set.

Cheers,

Michael

Change History

(follow-up: ↓ 2 ) 08/12/08 14:33:22 changed by apdavison

  • status changed from new to closed.
  • version set to trunk.
  • resolution set to fixed.
  • milestone set to Release 0.5.0.

Fixed in r440, although I'm not sure I've tested all the possible scenarios. The bug arose because copying the input spikes to the recorded spikes vector only occurred during set() if record() had been called previously. Now we set a flag, and do the copying during record() if it has not been previously done.

(in reply to: ↑ 1 ) 08/12/08 14:48:56 changed by mschmucker

Thanks for fixing that bug - it works for me!