[SciPy-Dev] (no subject)

Nathan Woods charlesnwoods at gmail.com
Tue May 10 22:20:33 EDT 2016


There have been a number of problems (e.g. GitHub issues #5002, #4831) with
the C interface of scipy.integrate.quad since work was done a couple of
years ago to allow performance optimizations (
https://github.com/scipy/scipy/commit/f5183a34a959d625c6b534e99df5db7ca49bf1ec).
Specifically, the QuadPack Fortran library does not really accommodate
multivariate integrand functions, which leads to all sorts of monkey
business in the API to hide that multivariate-ness. This is further
complicated by the fact that the QuadPack interface is one of the oldest
parts of SciPy and uses the Python C API directly, which many (most?) of us
are unfamiliar with.

I'd really like to figure out some kind of "good" solution to this. I think
that the requirements of the problem are fairly simple: connect the
existing scipy.integrate.quad routine to the underlying Fortran code, while
allowing users to use compiled function pointers as integrand functions, if
they want to (and are willing to put in some effort).

I guess that the question here is, what is the best way to go about this?
Should we simply find a way to fix the existing interface code? Should we
roll back the changes and disallow the use of function pointers in quad?
Should we replace the existing API with something else, using Cython or
f2py? Should we alter the QuadPack code itself (perhaps by adding a void*
argument to the function) to make it more friendly to multivariate
functions in general?

The current state of affairs bothers me, especially since I was involved in
the PR that  caused the new problems, but I haven't been able to come up
with a good way to fix things yet. I'd love to get some ideas and feedback
on how this could be resolved.

Nathan Woods
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20160510/d92e8f9e/attachment.html>


More information about the SciPy-Dev mailing list