-
-
Notifications
You must be signed in to change notification settings - Fork 11k
ENH: Add ma.convolve and ma.correlate for #6458 #7922
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
Conversation
cec08b7
to
a2f2ac7
Compare
Is |
a2f2ac7
to
0bd8645
Compare
It looks like the right file to me, and the code looks good. The only thing is whether "contagious" is the right name. The masked NEP distinguishes between "Unknown Yet Existing Data (NA)" and "Doesn’t Exist Or Is Being Skipped (IGNORE)" interpretations of the mask, which I think correspond to contagious vs not contagious. That NEP also uses the work "propagate" in a few places, to mean the "NA" case. "contagious" was already pretty good to me. I propose "propagate_mask", as another possibility. Thoughts? |
Is that NEP superseded by Looking at that document, it seems that |
The NEP was intended to replace it, but it was never implemented. I would consider the NEP as a collection of ideas on how maskedarray could be reimplemented in the future. |
(as far as I understand... it all happened before I was a contributor) |
IMO, |
Yeah, I think I agree, and personally I think "contagious" is pretty intuitive. Once we make the decision it is set in stone though, so we shouldn't take the decision too lightly. At least, it is set in stone until the time MaskedArray is overhauled somehow (which a fair number of people want to happen soon). In any case, I think we should write to the list to ask if contagious is the right word. Would you mind doing that? What about |
I guess the other question here is whether the default should be I'm not really sure what "the list" is, so would prefer it if you could do that |
All right, I put a message on the mailing list. Archive is here. |
All right, the consensus from the list discussion was that we should use I don't think there's anything else in the code to change. Could you also add a note in the release notes, in |
Pulling from the mailing list:
This raises the question of whether out-of-range values should be considered masked - should |
Also, is |
Hmm. I don't like that it would mean I hadn't noticed |
But it would mean that |
Darn, guess I'm rebasing now |
0fe7761
to
c311123
Compare
I'm fairly convinced that the "True" default is the right one, because as we saw on the list it's not totally clear in which cases "False" actually makes sense. So my instinct is to focus on the "True" case so it works as sensibly as possible. Also, I just noticed a bug, that you can't access |
As discussed in the mailing list
c311123
to
4c2ad8a
Compare
Wouldn't |
Unrelatedly, does numpy have a |
Ok, this PR should be ready for review - docs updated, argument name fixed, and the bug you mentioned earlier is fixed and tested. |
So I'm going to merge. Thanks @eric-wieser ! |
Implements the function requested in #6458
contagious
parameter could probably be better namedNo tests for correlate, but it should be pretty apparent that if it works for one it works for both