Ticket #78 (closed enhancement: fixed)

Opened 6 months ago

Last modified 6 months ago

monitors.py: Propagate spikes only if spikes exist

Reported by: mstimberg Owned by:
Priority: minor Milestone:
Component: Core Version: 1.3.0
Keywords: monitors Cc:

Description

Some of the monitors (I noticed it for SpikeCounter) process the spikes in every time step with statements like:

self.count[spikes] += 1

This takes considerable time even if the spikes array is empty. I'd therefore suggest to do it as in the Connection classes and put an "if len(spikes):" around such code.

Attached a patch (I also added some tests to increase the test coverage a bit ;) ) -- good enough to commit or do you see any problems?

Attachments

monitors_propagate.patch Download (5.1 KB) - added by mstimberg 6 months ago.
Patch to process the spike array only if it is not empty

Change History

Changed 6 months ago by mstimberg

Patch to process the spike array only if it is not empty

Changed 6 months ago by mstimberg

  • type changed from defect to enhancement

Changed 6 months ago by mstimberg

  • status changed from new to closed
  • resolution set to fixed

Romain said "it looks reasonable" -- commited as [2755]

Note: See TracTickets for help on using tickets.