-
Notifications
You must be signed in to change notification settings - Fork 107
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
#298 Make wrapping work with numpy 1.7 #373
Conversation
Wow Mike, that's awfully waffly - tell us how you really feel! ;) |
Looks good on my 4 systems too. |
For what its worth, I just tried building GalSim against NumPy 1.8 and it failed in the scons check even when I use this branch (but reverting to 1.7 worked for me):
|
Well it is weird that it would fail at compilation. Is 1.8 a developmental version? It's not in the list of official releases that I found. If it is just in development, then I think we don't have to worry about trying to fix that error (since in any case they could change it further before it gets officially released). However, it is good to have a heads up that we might have an issue with this in the future, so thanks for pointing it out. On Mar 20, 2013, at 9:36 AM, dkirkby notifications@github.com wrote:
Rachel Mandelbaum |
Yes, I was using the numpy dev snapshot from github. Given that this PR adds a line to SConstruct that refers specifically to 1.7, I wouldn't be surprised if the final 1.8 fails in the same way, but that's a problem for another day. |
I think numpy 1.8 is currently broken. Here is the end of the config.log file when I just tried it:
So it gives errors about including |
FYI, I updated the FAQ entry about this problem. |
#298 Make wrapping work with numpy 1.7
I think I have everything working with numpy 1.7 now.
I have to say, now that I've gone through this that their API is complete crap. And it has only gotten worse with this new change. You basically have to
reinterpret_cast
everything back and forth betweenPyObject*
andPyArrayObject*
. And I'm sorry, but anything that requires that much use ofreinterpret_cast
as a matter of course just to do the really normal things you would want to use it for is extremely poor design.Most of what I had to do was add even more explicit casts to make the arguments to various functions have the right type. They used to just work when everything was a
PyObject*
(although Jim already had a fair amount of other casting going on with the old API), but now they give errors if you pass aPyObject*
to most of the functions that want aPyArrayObject*
, even though their API documentation says "The input argument, arr, can be any PyObject * that is directly interpretable as a PyArrayObject * (any instance of the PyArray_Type and its sub-types)." But apparently that's just bullshit.Anyway, sorry for the rant. This is a pretty easy pull request. I've already tested it on systems that have numpy versions 1.2, 1.5, 1.6 and 1.7. So I think everything is copasetic. But give it a try to make sure it works on your system.