Skip to content

Commit

Permalink
Merge pull request #1424 from brian-team/fix_for_matplotlib
Browse files Browse the repository at this point in the history
Fixes indexing VariableViews with [:, np.newaxis] for subgroups
  • Loading branch information
mstimberg committed Jun 14, 2022
2 parents ffe16e8 + bd52ad0 commit 7ed9b6c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions brian2/core/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -1097,9 +1097,11 @@ def get_with_index_array(self, item):
len(item) == 2 and
isinstance(item[0], slice) and
item[0] == slice(None) and
item[1] is None and
self.index_var == '_idx'):
return variable.get_value()[item]
item[1] is None):
if self.index_var == '_idx':
return variable.get_value()[item]
else:
return variable.get_value()[self.index_var.get_value()][item]
else:
indices = self.indexing(item, self.index_var)

Expand Down

0 comments on commit 7ed9b6c

Please sign in to comment.