Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Casting the incoming list-like "post_indices" to numpy array #597

Merged
merged 2 commits into from
Sep 5, 2023
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
4 changes: 4 additions & 0 deletions pygenn/genn_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,10 @@ def set_sparse_connections(self, pre_indices, post_indices):
raise Exception("when weight sharing is used, set_sparse_connections"
"can only be used on the 'master' population")
elif self.is_ragged:
# Cast index arrays to numpy arrays if necessary
pre_indices = np.asarray(pre_indices)
post_indices = np.asarray(post_indices)

# Lexically sort indices
self.synapse_order = np.lexsort((post_indices, pre_indices))

Expand Down