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

Change the way find_neighbor_ methods work when flatten is False #2424

Open
jgostick opened this issue May 11, 2022 · 1 comment
Open

Change the way find_neighbor_ methods work when flatten is False #2424

jgostick opened this issue May 11, 2022 · 1 comment

Comments

@jgostick
Copy link
Member

At present flatten=False it returns a list of lists, which is not very numerically efficient. Instead is should return as CSR-style, so instead of [ [0, 2, 4], [4, 6]] it returns ([0, 2, 4, 4, 6], [0, 3]) where the second element of the tuple is indices into the first element where each new row starts. You could get each set of neighbors with ind, ptr = <crs-style data> so ind[ptr[0]:ptr[1]]

@jgostick jgostick added this to the v3.0 - API changes milestone May 11, 2022
@jgostick jgostick changed the title Change the way find_neighbor_ method works Change the way find_neighbor_ methods work when flatten is False May 25, 2022
@jgostick
Copy link
Member Author

This would really hurt readability. Maybe a better idea would be to add an additional option or function to get this CSR style if needed for performance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant