Skip to content

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

Closed
wants to merge 7 commits into from

Conversation

mwiebe
Copy link
Member

@mwiebe mwiebe commented Jul 10, 2011

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.

mwiebe added 7 commits July 9, 2011 23:48
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,
Copy link
Member

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 ;)

Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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.

@charris
Copy link
Member

charris commented Jul 11, 2011

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?

@mwiebe
Copy link
Member Author

mwiebe commented Jul 11, 2011

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.

@charris
Copy link
Member

charris commented Jul 11, 2011

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.

@charris
Copy link
Member

charris commented Jul 11, 2011

More on git and trailing whitespace at stack overflow.

@charris
Copy link
Member

charris commented Jul 11, 2011

So this stripped the whitespace:

curl https://github.com/numpy/numpy/pull/108.patch | git am --whitespace=strip

Cool!

@charris
Copy link
Member

charris commented Jul 11, 2011

Pushed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants