NeuralEnsemble / PyNN

A Python package for simulator-independent specification of neuronal network models.
Other
276 stars 126 forks source link

Bug in PyNN 0.9.5 in nest Recorder._recorder #667

Closed antolikjan closed 3 years ago

antolikjan commented 4 years ago

I believe I found a bug in the nest interface nest.Recorder._recorder function:

def _record(self, variable, new_ids, sampling_interval=None):         """         Add the cells in new_ids to the set of recorded cells for the given         variable. Since a given node can only be recorded from by one multimeter         (http://www.nest-initiative.org/index.php/Analog_recording_with_multimeter, 14/11/11)         we record all analog variables for all requested cells.         """         if variable == 'spikes':             self._spike_detector.add_ids(new_ids)         else:             self.sampling_interval = sampling_interval             self._multimeter.add_variable(variable)             self._multimeter.add_ids(new_ids)

The problem is that the variable=='spike' condition doesn't contain the line:         self.sampling_interval = sampling_interval

If one calls the pyNN record function on population, one can specify sampling_interval. If one makes multiple such calls, for example with different variables, pyNN is checking if all of them are using the same sampling interval, by checking against the self.sampling_interval. This works fine, if the first call of record is on variable that is not 'spikes'. On that call the code above set's the self.sampling_interval to a value, and then the next calls have to be with the same value (see assert in the Recorder.record). But if the first call is with a variable 'spikes' this doesn't happen (because of the missing line abobe), and even if all the calls to record are with the sampling_interval of the same value it complains that they are not.