Skip to content

Commit

Permalink
Use a specific index for the _count attribute. This might fix issue…
Browse files Browse the repository at this point in the history
…s with indexing errors
  • Loading branch information
Marcel Stimberg committed Feb 21, 2015
1 parent 092eb57 commit 94aa2f3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion brian2/monitors/spikemonitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ def __init__(self, source, record=True, when='end', order=0,
dtype=np.int32, constant_size=False)
self.variables.add_dynamic_array('t', size=0, unit=second,
constant_size=False)
self.variables.add_arange('_source_i', size=len(source))
self.variables.add_array('_count', size=len(source), unit=Unit(1),
dtype=np.int32)
dtype=np.int32, read_only=True,
index='_source_i')
self.variables.add_constant('_source_start', Unit(1), start)
self.variables.add_constant('_source_stop', Unit(1), stop)
self.variables.add_attribute_variable('N', unit=Unit(1), obj=self,
Expand Down

0 comments on commit 94aa2f3

Please sign in to comment.