Fix index types#2067
Merged
Merged
Conversation
flying-sheep
commented
Jul 31, 2025
Comment on lines
+47
to
+48
| | pd.Series # bool, int, str | ||
| | pd.Index |
Member
Author
There was a problem hiding this comment.
I don’t think we test these (at least not via subset_func and therefore with test_views_of_views)
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2067 +/- ##
==========================================
- Coverage 86.81% 85.55% -1.26%
==========================================
Files 46 46
Lines 7052 7067 +15
==========================================
- Hits 6122 6046 -76
- Misses 930 1021 +91
|
meeseeksmachine
pushed a commit
to meeseeksmachine/anndata
that referenced
this pull request
Jul 31, 2025
flying-sheep
added a commit
that referenced
this pull request
Jul 31, 2025
Co-authored-by: Philipp A <flying-sheep@web.de>
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.
Ilan made some good progress here, so this is intended to finish things up.
We have two “deal with indices” helpers in
anndata._core:.index._normalize_indexwhich accepts broad user-supplied types and unifies them into simple versions, and.views._resolve_idxswhich simplifies multiple successive indexing operations (views of views).Currently we have several “1D” (along the obs or var axis) index types which I’ll refer to by their name in the code:
Index1D: to capture user-supplied values likelist[str],int,pd.Series[bool]and so on.Index1DNorm(new): stored in anndata views as_oidx/_vidx: Can be asliceornp.ndarraywith dtypenp.bool_ornp.integer_init_as_actual: can beIndex1DNormor anint/np.integer. We should probably get rid of this and sliceify 0D indices in_normalize_indexTODO:
pd.Index[???]do we support?)