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
What to do about PyCXX? #3498
Comments
What are the alternatives? Cython, Boost.Python, Pyplusplus, Swig? |
I'm not a huge fan of any of the alternatives, except possibly the raw Python/C API. A viable alternative is also to keep using our own fork of PyCXX, but make a separate release so that distro packagers don't complain. |
In my view, the only potentially acceptable alternatives to continuing with our own PyCXX are Cython and raw. Cython works well for C, and is solidly established in our ecosystem. I know work has been done to improve C++ support, but I don't know how far it has gotten. If it is adequate for our C++ interfacing needs, then it would be my preference. Longer term, I don't like the idea of mpl needing to support a full-blown project like PyCXX, but it might be the least-bad option. |
@efiring: Yes, I would vote for phasing out PyCXX. In the interests of seeing how hard it would be to support PyCXX I did attempt to add numpy arrays to it. Although I made some progress, I concluded that the code was too esoteric for occasional maintenance, i.e. I would not choose to support it. As for replacements, I agree with the raw Python/C API and/or Cython as we concluded in the discussion on matplotlib-devel some time ago. Personally I would opt for the raw Python/C API as I am familiar and comfortable with it. I don't see the transition from PyCXX to raw Python/C API as being any big deal, as PyCXX extensions already have to use the raw Python/C API for numpy arrays anyway. Incidentally, I initially wrote my first mpl extension using the raw Python/C API but was persuaded at the time to convert it to PyCXX as that was the preferred approach! If we want to standardise on Cython instead, I would be happy with that but as I have no experience of it I would need someone to convert one of our existing extensions from PyCXX to Cython to show me what to do, and then I would follow that. |
From my limited experience, it seems the C++ support is very good at this point. FWIW Cartopy is making use of Cython to wrap a C library (GEOS) and some C++ code in the same module https://github.com/SciTools/cartopy/blob/master/lib/cartopy/trace.pyx. |
Cython is also being actively developed and numpy, scipy are using Cython, |
Could Numba work here? (http://numba.pydata.org) |
@stretch97: No, numba is for speeding up loops in Python that can't be vectorized efficiently with numpy. We are using CXX mainly to wrap external libraries, together with some internal C++ code. It's a completely different operation. |
Just to update the original issue. master is now CXX-free with the exception of |
Closing. CXX is gone. |
The Sourceforge project seems to be gone. Is it abandoned? If so, what do we do about it?
The text was updated successfully, but these errors were encountered: