[SciPy-Dev] Expose Lapack for Cython

Ian Henriksen insertinterestingnamehere at gmail.com
Wed Nov 19 14:27:19 EST 2014


In working on the pull request to implement this, I've run in to some
trouble
in picking the right module structure for the new Cython modules. I'm
posting
here to see if we can get a few better ideas that what I currently have.

In the long run, I'd like to leave space so that wrappers that operate on
memoryviews instead of just pointers can be added to scipy.linalg.
This would, ultimately mean that there would be several new modules added
in scipy.linalg. One for each the sets of function pointers corresponding
to BLAS and LAPACK, and one for each of the modules defining routines
that operate on memoryviews.

I'm fairly certain that the C-compiled tests that are currently there
should not be included in the tests directories. I've never seen that
done anywhere else and was unable to get it working when I tried here.
One option would be to rewrite the tests so that they use Python
callable versions of the new Cython wrappers to test for correctness.
That will take me a little more time, but it is probably the best solution.

My current favorite idea for the structure is to do this

linalg/
   cython_blas_pointers (function pointers, already written)
   cython_blas (memory view versions, to be added later)
   cython_lapack_pointers (function pointers, already written)
   cython_lapack (memory view versions, to be added later)

and then rewrite the tests in pure Python using function calls to
cython_blas
and cython_lapack for the functions that I have tests for.

The names here are up for discussion too. The fact that these are function
pointers is really just an implementation detail, but I'm not really sure
what else
to call the raw function pointer interface. It seems to be the most
descriptive
choice, since these are function pointers that operate on pointers to
arrays.
If we wanted shorter module names we could do

linalg/
   cyblas
   cyblas_ptrs
   cylapack
   cylapack_ptrs

Another alternative would be to put these modules all in a new submodule
of scipy.linalg. The current version in the pull request does this, but
the submodule is called "cython" and that is causing name collision issues.
The submodule could instead be called "cylinalg" or "cython_wrappers", or
something else along those lines.

What are your thoughts?

Thanks!
-Ian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20141119/13c764ba/attachment.html>


More information about the SciPy-Dev mailing list