[SciPy-dev] Dropping djbfft ?

Robert Kern robert.kern@gmail....
Tue May 13 00:52:55 CDT 2008

On Tue, May 13, 2008 at 12:06 AM, David Cournapeau
<david@ar.media.kyoto-u.ac.jp> wrote:
> Anne Archibald wrote:
>  >
>  > How about a third approach (which I think may be what Robert Kern was
>  > suggesting)? Simply SWIGify (or cythonify or f2pyify) each library, so
>  > that they each provide their own API to python. Then write the
>  > detection/wrapper code in python, where it's relatively easy to muck
>  > about with dispatching and API finagling.
>  Yes, in my mind, that's the same thing: the complicated part is not the
>  wrapping (it is already done through f2py anway), but the
>  "libification", that is making sure that each backend is independant.
>  Doing it from scratch is easy, doing it gradually while keeping
>  compatibility is more work.
>  But well, since dropping djbfft was not an option, I went forward, and I
>  am almost done having one backend = one library in the refactor_fft
>  branch. I still need to fight with distutils, but I know it well enough
>  to win this time :)

I think we're still talking past each other. What I was suggesting is
that FFTW(3), MKL, etc. are moved to separate *packages* outside of
scipy. Each would expose Python-level fft(), rfft(), ... whatever each
library implements. Each package would have a registration function
which would tell scipy.fftpack that these are optimized
implementations that scipy.fftpack.fft(), etc. could call.
scipy.fftpack.fft() and friends would be pure Python and check to see
if an optimized version was registered (and possibly if the inputs are
a power of 2 if the optimized version requires it). If not, it falls
back to the FFTPACK implementation which comes with scipy.fftpack.

If it were feasible to build the djbfft library in our build system,
it would be nice if we could simply absorb the source into ours and
make it a non-optional backend. Otherwise, it also gets kicked out
into a scikit like the others.

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
 -- Umberto Eco

More information about the Scipy-dev mailing list