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

Conversation

tnowotny
Copy link
Member

@tnowotny tnowotny commented Sep 5, 2023

Previously, there was an error if "post_indices" was a list because self.synapse_order is a numpy array and therefore cannot be used to index into this list.

…t indexing into it with a numpy array is possible.

Previously, there was an error if "post_indices" was a list because self.synapse_order is a numpy array and therefore cannot be used to
index into this list.
@codecov
Copy link

codecov bot commented Sep 5, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (e684c1f) 88.74% compared to head (64c5f31) 88.74%.

❗ Current head 64c5f31 differs from pull request most recent head 60c0511. Consider uploading reports for the commit 60c0511 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #597   +/-   ##
=======================================
  Coverage   88.74%   88.74%           
=======================================
  Files          76       76           
  Lines       12490    12490           
=======================================
  Hits        11084    11084           
  Misses       1406     1406           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@neworderofjamie
Copy link
Contributor

Nice! Personally I would do:

pre_indices = np.asarray(pre_indices)
post_indices = np.asarray(post_indices)

right at the top of the is_ragged block as np.asarray() does nothing if the input's already an array and I suspect it'll be happening repeatedly inside np.lexsort and ``np.bincount` otherwise.

@tnowotny
Copy link
Member Author

tnowotny commented Sep 5, 2023

Ok, now changed ... and tested briefly on my sudoku code. It seems to work as well (as expected).

@neworderofjamie neworderofjamie merged commit 8f0c315 into master Sep 5, 2023
@neworderofjamie neworderofjamie deleted the fix_set_sparse_connections branch September 5, 2023 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants