-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add indexing support to SkipMissing #31008
Conversation
Define IndexStyle, eachindex, keys and getindex to match indices of wrapped array, skipping missing entries. This notably allows finding the index of elements in the wrapped array using findall, findnext, argmin/max and findmin/max.
I'm not sure that I'm the best person to review this. @mbauman, would you feel qualified to take a look at this and review it? |
Given the small amount of code introduced, I think what's needed is mainly a decision regarding the proposal at #30606. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great as is — just a few optional comments on docs that I noted as I was reading through.
Thanks! I've pushed a commit to try to improve the wording. |
I've just realized that |
Yup, that'll fit in nicely with my hope to do something about wider axis support beyond just |
Define
IndexStyle
,eachindex
,keys
andgetindex
to match indices of wrapped array, skipping missing entries. This notably allows finding the index of elements in the wrapped array usingfindall
,findnext
,argmin
/max
andfindmin
/max
.Fixes #29305. Part of #30606.
FWIW, iterating over
SkipMissing
usingeachindex
andgetindex
rather thaniterate
is slower, but not that much (and I see no reason why the compiler couldn't improve since the involved code is quite simple)EDIT: with@inbounds
annotations both solutions have the same performance (but the performance difference persists without it).