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

Fix neighborhood matrix indexing due to subsetting #824

Merged
merged 8 commits into from
Nov 23, 2022
Merged

Conversation

alex-l-kong
Copy link
Contributor

What is the purpose of this PR?

Closes #822. Patches an issue where passing a subsetted all_data in create_neighborhood_matrix causes indexing errors when using the index for cell_neighbor_counts and cell_neighbor_freqs.

How did you implement your changes

Call reset_index on all_neighborhood_data after subsetting the columns on all_data.

@alex-l-kong alex-l-kong self-assigned this Nov 11, 2022
@alex-l-kong alex-l-kong marked this pull request as draft November 11, 2022 03:44
@alex-l-kong alex-l-kong marked this pull request as ready for review November 22, 2022 21:58
@alex-l-kong
Copy link
Contributor Author

New indexing has been tested on the neighborhood analysis notebook, doesn't throw errors even if a non-continuous 0-based index is passed.

Copy link
Member

@ngreenwald ngreenwald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@ngreenwald ngreenwald merged commit 1b2183c into main Nov 23, 2022
@ngreenwald ngreenwald deleted the neigh_index branch November 23, 2022 05:19
@srivarra srivarra added the bug Something isn't working label Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

create_neighborhood_matrix assumes continuous index in cell table
3 participants