-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
TST, MAINT: Lots of new tests for fromnumeric.py #7027
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
Please don't rebase. |
PR is no longer WIP. Travis + Appveyor are both passing. Should be good to merge now. |
|
||
def test_basic(self): | ||
A = np.choose(self.ind, (self.x, self.y)) | ||
A = self.ind.choose((self.x, self.y)) |
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.
Should keep the first version in order to test the funtion, not the method.
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.
Same below.
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.
Done.
Looks generally good, but the common mistake is to substitute methods for functions. The two aren't the same despite the apparent redundancy. The methods should actually be tested in the |
@charris : Changes made and Travis / Appveyor are happy. |
@@ -1,17 +0,0 @@ | |||
from __future__ import division, absolute_import, print_function |
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.
Why remove this file? fromnumeric.py
is a package containing a number of functions. put
is also a function implemented in fromnumeric.py
.
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.
I added that file myself from #7000 that served as a stopgap measure to test that put
would not accept non-ndarray
args. Also, a lot of the tests of fromnumeric.py
functions are located elsewhere in the tests.
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.
Hmm, at some point we need to reorganize numpy/core
, but I suppose that is for another day.
I think you need to check carefully where functions/methods etc are defined. The easy way to check functions in ipython is to use the |
If you look at the functions defined in My original intention was to write an entire |
TST, MAINT: Lots of new tests for fromnumeric.py
Thanks @gfyoung . |
Follow-up from #7000 in which I found there seemed to be a gap in testing for the
numpy/numpy/core/fromnumeric.py
file. This PR improves the coverage on the methods defined in that file.