BUG: Fix string copying for np.place#7003
BUG: Fix string copying for np.place#7003jaimefrio merged 1 commit intonumpy:masterfrom gfyoung:place_str_fix
Conversation
|
Tests haven't finished yet, but I know it will have at least one test failure with |
|
In light of the discussion in #7000, I am removing |
|
Travis build #9122 doesn't seem to be starting up on the i386 build. Since the build is bad anyways, could somebody with the permissions kill that build? Thanks! |
|
Actually, I think something weird is going on with Travis right now. Travis build #9123 is completely stalling both on i386 and USE_DEBUG=1. Could someone kill that build (it has test failures) as well? Thanks! |
|
Yep, it's definitely something with Travis. Build #9124 is stalling as well on like half of the build machines. |
|
Did |
|
Okay! Now with all of the testing issues fixed and resolved, I think this should be good to merge. If someone else could take a look at it just in case I missed anything, that would be great! |
|
Can someone take a look at this? I've been rebasing this PR onto |
There was a problem hiding this comment.
This check is redundant, already done by PyArg_ParseTupleAndKeywords when using O!.
There was a problem hiding this comment.
Ah, good point. Done.
|
Can someone take a look at this? Unless there are more things to refactor in the C code, I think this should be good to merge. |
There was a problem hiding this comment.
Moving these NULL assignments to the variable declaration may minimize the risk of them being removed inadvertently.
|
Minor style nitpicks, almost there! |
|
As far as I can tell, this also addresses #7207 |
|
@jaimefrio : Changes have been made, and tests are passing. If there is nothing else, should be good to merge. |
|
@jaimefrio : Any update on whether or not this PR is good to merge? Also, if anyone else would like to take a look at this, that would be great. This PR has been ready to land for some time now. |
|
Does anyone want to take a look at this? Should be good to merge. |
There was a problem hiding this comment.
I think the code would be a little easier to follow if you renamed your variables: max_item -> ni and ni -> nm.
|
A couple of style nitpicks, plus there is a little too much vertical whitespace for my liking. But yes, it is indeed pretty much ready. |
Fixes bug in string copying in np.place in which replacements strings that were smaller than their replaced elements would only partially replace the element instead of the entire element. Closes gh-6974. Addendum: this commit also appears to have fixed issue with overflow for very large input arrays. Closes gh-7207.
|
@jaimefrio: Made style nitpicks changes (+ removed extraneous vertical whitespace) without angering either Travis or Appveyor. Should be good to merge if there is nothing else. |
BUG: Fix string copying for np.place
|
Thanks a lot for putting this together, and for your patience with the lengthy reviews, in it goes. |
|
@jaimefrio : No worries. Compatibility issues between |
Addresses issue in #6974 with regards to string copying in
np.placein which replacements strings that were smaller than their replaced elements would only partially replace the element instead of the entire element.Previous behavior:
New behavior: