-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Missingdata - Finish masked iteration, fix ufunc 'where=' with buffered output, add documentation #108
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
This still needs tests, I've only validated that it doesn't break anything already in the tests.
…h masks This was suggested by Eric and Nathaniel on the mailing list.
…d broadcasting When both casting and broadcasting are occurring, and the total size of 'src' is smaller than the default NumPy buffersize, this tells the iterator to make a copy with the 'dst' dtype so most of the operations are simple copies with no cast.
@@ -1156,3 +1156,139 @@ PyArray_TransferStridedToNDim(npy_intp ndim, | |||
} | |||
} | |||
} | |||
|
|||
NPY_NO_EXPORT npy_intp | |||
PyArray_TransferMaskedStridedToNDim(npy_intp ndim, |
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.
Boggle. Amazing number of arguments ;)
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.
The names are pretty descriptive, with the exception of coords (multi_index?), but at some point we really nees to document some of these functions.
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.
There is some documentation here:
https://github.com/numpy/numpy/blob/master/numpy/core/src/private/lowlevel_strided_loops.h#L231
Maybe it's worth indicating where to look in a comment in the .c file as well.
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.
Ah, that helps quite a bit.
All the tests pass on 2.7 and 3.2 (except the usual), git warns of trailing whitespace. You mention reduce but I don't see anything using it yet, is that something for the future? |
Is there an option you have enabled in git for the trailing whitespace? The parts regarding reduce were about setting up error checking to ensure correctness. Implementing NA support in einsum would be instructive about how these features should interact, I think. |
The whitespace warnings come from git-apply, called from git am. Hmm, there is an option to strip it, I need to play with that. I use a perl program (nabbed from the linux mailing list) to strip trailing whitespace. I'll send it along if you want. |
More on git and trailing whitespace at stack overflow. |
So this stripped the whitespace:
Cool! |
Pushed. |
feat: Add vcnt_s8
The two flags NPY_ITER_WRITEMASKED and NPY_ITER_ARRAYMASK now fully work. This made it easy to fix the ufunc 'where=' bug. Also added documentation of the new iterator flags and inline functions for dealing with masks.
Special thanks to Chuck, Eric, and Nathaniel for reviewing and providing feedback on my last pull request.