[SciPy-dev] fftpack: building all backends and setting them at runtime (was dropping djbfft)

David Cournapeau david at ar.media.kyoto-u.ac.jp
Fri May 16 02:26:53 EDT 2008


Hi,

    After some more work, I have modified scipy.fftpack such as backends 
are truely independent code-wise, and can be selected at runtime. I hope 
it adresses all remarks comments made in the previous thread:

http://projects.scipy.org/scipy/scipy/browser/branches/refactor_fft/

Concretely:
    - all fftw/fftw3/djbfft/mkl code has been put in 
scipy/fftpack/backends directory.
    - fftpack is always build and used by default for all functions
    - for each backend, if the corresponding libraries are available, 
the module is built (so if you have mkl, fftw, fftw3 and djbfft, all 
backends will always be built)
    - fftpack module now uses some magic to set up functions from one 
backend or the other (scipy/fftpack/common.py). Basically, the functions 
are defined at runtime depending on which backend is selected. If the 
function is not available, the default backend is used as a fallback.

TODO:
    - I have not implemented any registration method, because I was not 
sure how to do it (config file, monkey patching, import magic ?).
    - The convolution module is not done yet.
    - I have not implemented djbfft backend yet (all the other ones 
should work), because it needs a bit more logic, but nothing serious.
    - All module .pyf files are almost duplication, but since we want to 
have them independent, I am not sure how to do better.

It should be possible to put all the code in backends out of scipy once 
the registration system is in place.

cheers,

David



More information about the SciPy-Dev mailing list