0ac2bf1c2cafee4cc9555c9f09a17143b05b1a88,brian2/synapses/spikequeue.py,SpikeQueue,prepare,#SpikeQueue#Any#Any#Any#,91

Before Change


        max_events = 0
        synapse_sources = synapse_sources[:]
        for source in xrange(self._source_end - self._source_start):
            indices = np.flatnonzero(synapse_sources == (source +
                                                         self._source_start))
            size = len(indices)
            self._neurons_to_synapses.append(indices)
            max_events = max(max_events, size)

        n_steps = max_delays + 1
        
        // Adjust the maximum delay and number of events per timestep if necessary

After Change


        // Prepare the data structure used in propagation
        synapse_sources = synapse_sources[:]        
        nsource = self._source_end - self._source_start
        ss = np.ravel(synapse_sources)
        I = np.argsort(ss)
        ss_sorted = ss[I]
        splitinds = np.searchsorted(ss_sorted, np.arange(self._source_start, self. _source_end+1))
        self._neurons_to_synapses = [I[splitinds[j]:splitinds[j+1]] for j in xrange(len(splitinds)-1)]
        max_events = max(map(len, self._neurons_to_synapses))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: brian-team/brian2
Commit Name: 0ac2bf1c2cafee4cc9555c9f09a17143b05b1a88
Time: 2014-03-06
Author: dan.goodman@ens.fr
File Name: brian2/synapses/spikequeue.py
Class Name: SpikeQueue
Method Name: prepare


Project Name: nipy/dipy
Commit Name: 1a8468988ae35b6d3814288018fc2f9056e74974
Time: 2011-07-21
Author: garyfallidis@gmail.com
File Name: dipy/reconst/gqi.py
Class Name: GeneralizedQSampling
Method Name: __init__


Project Name: scipy/scipy
Commit Name: 4c08f6a92d547a3308164499ec92d35254ed1da5
Time: 2017-02-24
Author: philip_deboer@scotiacapital.com
File Name: scipy/stats/tests/test_multivariate.py
Class Name: TestUnitaryGroup
Method Name: test_haar