Skip to content

Commit

Permalink
Use numpy's concatenate instead of hstack, it's apparently faster
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcel Stimberg committed Jul 23, 2013
1 parent 1f2642c commit ac84555
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions brian2/synapses/synapses.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ def pre_update(self):
# Push new spikes into the queue
spikes = self.source.spikes
if len(spikes):
indices = np.hstack((self.synapse_indices[spike]
for spike in spikes)).astype(np.int32)
indices = np.concatenate([self.synapse_indices[spike]
for spike in spikes]).astype(np.int32)
if len(indices):
if len(self._delays) > 1:
delays = np.round(self._delays[indices] / self.dt).astype(int)
Expand Down

0 comments on commit ac84555

Please sign in to comment.