Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

This is a fix for issue #136. #138

Merged
merged 3 commits into from
Jan 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions brian2genn/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -1588,8 +1588,16 @@ def process_state_monitors(self, directory, state_monitors, writer):
sm.when = 'end'
if isinstance(src, Synapses):
sm.isSynaptic = True
sm.srcN = src.source.variables['N'].get_value()
sm.trgN = src.target.variables['N'].get_value()
neuron_src = src.source
# in brian2genn, we need the size of the entire pre-synaptic neuron population, not a sub-group size
if isinstance(neuron_src, Subgroup):
neuron_src = neuron_src.source
sm.srcN = neuron_src.variables['N'].get_value()
neuron_trg = src.target
# in brian2genn, we need the size of the entire post-synaptic neuron population, not a sub-group size
if isinstance(neuron_trg, Subgroup):
neuron_trg = neuron_trg.source
sm.trgN = neuron_trg.variables['N'].get_value()
sm.connectivity = self.connectivityDict[src.name]
else:
sm.isSynaptic = False
Expand Down