-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Don't use deprecated numpy APIs #3547
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
Conversation
Using the replace_old_macros.sed script distributed with numpy.
Couple it with Python 2.6, since those are older versions of the dependencies.
By defining a macro in setupext.py
ad1ba58
to
e3d70c0
Compare
I like this. astropy is currently doing something very similar, though more controversially since astropy is still trying to support numpy >= 1.5. I have no problems with this, as it seems to pass all tests. |
One small thing: I noticed that this causes a massive number of warnings when compiling _macosx.m. Apparently the implicit cast on function call is legal Objective-C but produces a warning, whereas it's an error in C (or is it only in C++?). I could fix those errors before merging. |
I tried that last commit by running IPython --pylab with the MacOSX backend and executing examples/pylab_examples/quadmesh_demo.py, examples/pylab_examples/tripcolor_demo.py and examples/api/histogram_path_demo.py. All demos seemed to work fine. |
Cc: @mdehoon |
Thanks to @mdehoon for catching these!
Since I fixed the problems found by @mdehoon and no one else has objected, is this ready to merge? I agree with @tacaswell's milestone of 1.5.x, there should be no need to backport to 1.4.x. |
cc @mdboom I bet this conflicts with your massive cxx removal effort... |
@tacaswell: Yes, it probably does. It's going to be a pretty manual merge process, but at least I'll have this as a guide. It doesn't hurt to merge this, but it is likely to be short-lived. |
Manually resolved the conflict and merged. |
There are three main things about the deprecated APIs:
PyArray_UINT8
toNPY_UINT8
PyArrayObject
fields directly, instead you have to use accessor functionsPyObject*
without typecastingThis changes the Travis configuration to require numpy==1.6 in one build, to ensure that we stay compatible with the version advertised in documentation. This also adds #defines to make reliance on the deprecated APIs a compilation error.
Fixes #2092.