-
-
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 keepat! for in-place logical filtering #39528
Conversation
Could doc strings be added for this? Otherwise lgtm |
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.
With docs this should be good to go I think
Done! I also added a |
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.
Can you add a reference to this into doc/src/base/arrays.md
Co-authored-by: Jameson Nash <[email protected]>
Co-authored-by: Jameson Nash <[email protected]>
I can add this to |
yeah, that sounds good |
""" | ||
function mask!(a::AbstractVector, m::AbstractVector{Bool}) | ||
j = firstindex(a) | ||
for i in eachindex(a, m) |
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.
Q for anyone: is eachindex
and nextind
/ iterate
guaranteed to be in the same visit order?
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.
Shouldn't we unify the names with |
Good point to bring this up. Are these two PRs stalled on bikeshedding a name? |
Removing merge me label and marking for triage since it looks like there still has to be a definite decision made on the name. |
Is the reason we want this just because |
triage says |
Okay, I'll amend the PR with the new name, sorry I couldn't make the Triage call. |
@MasonProtter did you close this by inadvertently? |
Reopened in case. Can close again if it was on purpose. |
I closed this because #36229 was merged, which is the exact same thing, right? I didn’t realize they were doing the same thing until yours was merged @rfourquet or I wouldn’t have opened this one in the first place. |
I believe they do different, but complimentary things |
Yes IIRC, the method from the other PR was receiving indices, while this one here receives a boolean mask. |
🤦 well im glad you paid closer attention than I did! Should these be methods of the same function, or different functions? |
Triage decided on different methods a few weeks ago when we discussed this. The reason is that deleteat has methods for both. |
will this get 1.7 label? I would like to add |
Superseded by #42351 |
Closes #39470