-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Pandas fix #50
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
Pandas fix #50
Conversation
I'm thinking raising an error might be the right thing to do as long as creating an object array still worked. As is, "setting an array element with a sequence" gets thrown and we could do that more directly. |
Another thing I noticed in the discover_dimensions function is that it doesn't check for the array attribute. The Series object in pandas has that attribute and it may be that what pandas is doing is a workaround for the fact that the old code didn't handle that case either. |
And here's the code of python's PySequence_Check
|
Is Pandas using old-style classes? That's what PyInstance_Check is for, and it goes away in Python 3. If not, then it looks like it is implementing the sequence protocol incorrectly as I suspected. |
They all seem to be derived from object somewhere down the line. There are now four errors exposed in the numpy tests which I think result from passing the -1 error return back up the chain, it seems it need to be handled when first seen.
|
You probably need to investigate which C code is triggering these exceptions - it might be the part copying the values into the array, not discover_dimensions. |
Yeah, I'll come back to it this evening. |
Here's the strange thing. The code differs from the original only in the addition of the checks. I put print statements in them and those paths are never taken. Yet the new code produces errors like
Hmm... |
Never mind, cut-n-paste error fixed. |
I've implemented the error pass through for everything but KeyError, but I haven't uploaded it yet. I think it may be too finicky about other people's code. On the other hand, just getting an object might be confusing also. |
processing except KeyError. In the latter case an object is forced.
OK, it's up ;) I guess we can see how it goes. |
Looks good to me. Might be worth checking if this affects Ticket #1715 as well. |
Ticket #1715 is a bit of a mystery. I get an array with the three rgb components and I have no idea why since the img object has neither |
Interesting - I get a flipped image shape (603, 1024, 3) instead of (1024, 603, 3) as would seem natural, but otherwise looks good for me too. |
I'm thinking that I have the decoder installed and that the image class must be checked for during the construction of the scalar. Probably Nil's needs to check this in the case where and exception is raised. |
Merge in ~STEPAN.SINDELAR_ORACLE.COM/numpy-hpy from mq/nonzero_compress to labs-hpy-port * commit 'a8645e2467ddbfc0a78d0f08cff9219214ab2511': Migrate PyArray_Nonzero and HPyArray_Compress
This fixes the pandas segfault and all except one of the pandas tests pass. I don't think it is complete, however. In particular the error return (-1) is just passed back up the call chain whereas it should perhaps be caught at the first level where it is the return value. Mark, any comments about that?