Repository navigation
Restore Pandas membership checks for string instance IDs - #1280
Open
sophiamaedler wants to merge 2 commits into
Open
sophiamaedler wants to merge 2 commits into
sophiamaedler wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1280 +/- ##
=======================================
Coverage 91.42% 91.42%
=======================================
Files 53 53
Lines 8381 8381
=======================================
Hits 7662 7662
Misses 719 719
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1279.
_get_joined_table_indicesand_get_masked_elementuse NumPyisinto match table instance IDs against spatial element indices. For object or string IDs, this can trigger repeated element-wise comparisons and makebounding_box_querysubstantially slower. This PR uses PandasSeries.isin()in both helpers while preserving the existing join behavior.Benchmark
Using the benchmark script and the public Xenium breast cancer dataset linked in the issue, I ran ten crops per ID type on
mainand this PR branch. The dataset has 167,780 cells; each crop retained 199 cells. For the string-ID case, the sample’s numeric IDs were cast to strings in memory.mainmedianThe benchmark script is attached to issue #1279.