-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Fix csgraph py3k build #243
Conversation
Now the tests install, there are also four failures left (release blocker): http://projects.scipy.org/scipy/ticket/1669 |
Thanks for checking into this! |
I'm guessing a 32-bit vs. 64-bit issue instead of Py2 vs Py3. Before the tests were only run for my in-place build, which is 32-bit Python 2.6. The 3.x builds on OS X are 64-bit. |
It may be better to merge this and investigate the issue further on the ticket I opened, to not mix everything up. |
I'll have a look at the 2.4 issues. |
I saw the 2.4 fixes in #244. Just to be sure - the remaining 2.4 issues have no relation to csgraph, correct?
perhaps this has something to do with it? I'm not sure whether or not that is normal. |
Correct, the remaining 2.4 issues are in the integrate module. The 32/64-bits of Python can indeed be different from that of the underlying OS. On my machine
The Cython functions should work with all types of inputs, but it looks like you only considered 32-bit. There's some recent PRs that used Cython fused types to handle this issue, but I'm not an expert on that. You could ask on the mailing list. |
The strange thing is I used the same typedefs (float64/int32) in the cython code for the scikit-learn Ball Tree implementation, and that's been in use for over a year with no problems reported. I'll try to see if I can figure out where it's going wrong. |
Looks like you might be using Py_ssize_t somewhere. It isn't in 2.4 but numpy defines it to be int for python call compatibility. |
|
Py_ssize_t was new in 2.5. I'm not sure what Cython does, but numpy defines it to an int for 2.4, which is 32 bits on 64 bit windows systems. It should only be used when calling the python c-api, so shouldn't be a problem if none of the .pyx/.pyd files uses it. I was just making a guess as to what might be going on. |
I need this to test release builds, so I merged it. Will also merge the 2.4 fixes. |
@jakevdp I see you changed I asked this on ticket 1669 too, but can someone explain why
in parameters.pxi should work for 64-bit systems? Finally, in 511eda0 @pv changed If anyone has either a simple explanation or a reference on how to define integer types portably, that would be great. |
I think the point with Of course, int32 will work also on 64-bit systems, if one is also careful with the types of the Numpy arrays involved. |
I think @pv is correct: because all these functions need to work efficiently with the indices of sparse matrices, the |
The relevant piece is in the A quick and dirty fix for this particular error would be to use Bottom line: we need to somehow assure that the int type used in |
@jakevdp: the fixes Pauli made, linked on http://projects.scipy.org/scipy/ticket/1669, already fix the issue. There's only one failure left now, which doesn't seem to be related to |
All the failures should be fixed by c89abe6 in master |
Thanks for all the work on this Pauli and Ralf! |
Tests were also not installed with regular
python setup.py install
.