add keepat! for in-place logical filtering#39528
add keepat! for in-place logical filtering#39528MasonProtter wants to merge 8 commits intoJuliaLang:masterfrom
Conversation
|
Could doc strings be added for this? Otherwise lgtm |
kshyatt
left a comment
There was a problem hiding this comment.
With docs this should be good to go I think
|
Done! I also added a |
vtjnash
left a comment
There was a problem hiding this comment.
Can you add a reference to this into doc/src/base/arrays.md
Co-authored-by: Jameson Nash <vtjnash@gmail.com>
Co-authored-by: Jameson Nash <vtjnash@gmail.com>
|
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.
Q for anyone: is eachindex and nextind / iterate guaranteed to be in the same visit order?
There was a problem hiding this comment.
|
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