-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
BUG: Fix partition and argpartition error for empty input. Closes #6530 #6553
Conversation
@njsmith @jaimefrio It is throwing a deprecation warning in one test case. What should I do ? I had 2 things in mind, either use |
@njsmith @jaimefrio Nevermind , its resolved. The problem was that the 32 bit system was trying to cast array into 64 bit. I used |
@jaimefrio This look good to you? The fix is as you suggested. |
There are |
@jaimefrio Can you find time to put together a PR? @yashmehrotra No offence intended, but I want this fix soon for 1.10.2 and would prefer if someone familiar with the code got it done rather than go back and forth with corrections. |
@charris It's ok, I understand, but I'd still commit the new changes that @jaimefrio mentioned. If it is working, we can merge it else I'll close this PR 😄 . |
@@ -68,6 +68,21 @@ def test_unicode_mode(self): | |||
k = b'\xc3\xa4'.decode("UTF8") | |||
assert_raises(ValueError, d.take, 5, mode=k) | |||
|
|||
def test_partition(self): |
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 be called test_empty_partition
to make clear what's special about this test
@charris: I did some careful review of the actual change to |
|
||
assert_equal(a, None) | ||
|
||
def test_argpartition(self): |
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.
oh right, and this should be called test_empty_argpartition
OK, one more comment about tests and then I promise I'm done :-). We should also the following to
because this was the call that I actually ran into the problem with (percentile calls partition internally). So it should be fixed by this, but we should add a test to make sure it stays fixed too. |
@njsmith Oh, cool. I added the regression test. I hope its good to go now. |
LGTM, but I'll let @charris decide as release manager how he wants to handle this (presumably after confirming that the tests actually pass ;-)). |
@njsmith Sure, No problem. |
BUG: Fix partition and argpartition error for empty input. Closes #6530
@yashmehrotra Thanks, merged. |
Thanks for cleaning up my mess, all three of you! |
If you buy us beer and plane tickets we'll help you move ;) |
+1. I am with charles on this one. 😛 |
No no, you call it a "dev meeting" and get some company to pay for it ;-) On Tue, Oct 27, 2015 at 9:17 PM, Charles Harris notifications@github.com
Nathaniel J. Smith -- http://vorpus.org |
* 'master' of https://github.com/numpy/numpy: (384 commits) BUG: fix MANIFEST.in for removal of a file in numpygh-8047. DOC: Release notes for Numpy 1.10.2. MAINT: remove useless files with outdated info from repo root and doc/. MAINT: fix mistake in doc upload rule TST: attempt to make test_load_refcount deterministic BUG: Fix for numpy#6569, allowing build_ext --inplace TST: Added regression test empty percentile, in ref to numpy#6530 and numpy#6553 TST: Added tests for empty partition and argpartition BUG: revert view safety checks TST: Remove tests of view safety checks (see next commit) BUG: Revert some import * fixes in f2py. BUG: Fixed partition errors on empty input. Closes numpy#6530 DOC: import "numpy for matlab users" from the wiki DOC: reorganize user guide a bit + import "tentative numpy tutorial" from wiki DOC: remove placeholders and incompleteness warnings MAINT: minor update to "make upload" doc build command. BUG: error in broadcast_arrays with as_strided array BUG: fix inner() by copying if needed to enforce contiguity DOC: clarify usage of 'argparse' return value. BUG: Make median work for empty arrays (issue numpy#6462) ...
Fixes #6530 .