# This module should be used for functions both in numpy and scipy if
#  you want to use the numpy version if available but the scipy version
#  otherwise.
#  Usage  --- from numpy.dual import fft, inv

__all__ = ['fft','ifft','fftn','ifftn','fft2','ifft2',
           'inv','svd','solve','det','eig','eigvals','lstsq',
           'pinv','cholesky','i0']

# First check to see that scipy is "new" scipy
# Perhaps we could check to see if the functions actually work in
#  the scipy that will be imported.


have_scipy = 0
try:
    import scipy
    if getattr(scipy, '__version__', None) >= '0.4.4':
        have_scipy = 1
except ImportError:
    pass

if have_scipy:
    import scipy.linalg as linpkg
    import scipy.fftpack as fftpkg
    from scipy.special import i0
else:
    import numpy.linalg as linpkg
    import numpy.dft as fftpkg
    from numpy.lib import i0

fft = fftpkg.fft
ifft = fftpkg.ifft
fftn = fftpkg.fftn
ifftn = fftpkg.ifftn
fft2 = fftpkg.fft2
ifft2 = fftpkg.ifft2

inv = linpkg.inv
svd = linpkg.svd
solve = linpkg.solve
det = linpkg.det
eig = linpkg.eig
eigvals = linpkg.eigvals
lstsq = linpkg.lstsq
pinv = linpkg.pinv
cholesky = linpkg.cholesky


@@ -353,333 +353,18 @@
 '%5D%0A%0A
-# First check to see that scipy is %22new%22 scipy%0A# Perhaps we could check to see if the functions actually work in%0A#  the scipy that will be imported.%0A%0A%0Ahave_scipy = 0%0Atry:%0A    import scipy%0A    if getattr(scipy, '__version__', None) %3E= '0.4.4':%0A        have_scipy = 1%0Aexcept ImportError:%0A    pass%0A%0Aif have_scipy:%0A    import sci
+import num
 py.l
@@ -383,32 +383,24 @@
 pkg%0A
-    
 import 
-scipy.f
+numpy.d
 ft
-pack
  as 
@@ -410,116 +410,8 @@
 pkg%0A
-    from scipy.special import i0%0Aelse:%0A    import numpy.linalg as linpkg%0A    import numpy.dft as fftpkg%0A    
 from
@@ -430,16 +430,28 @@
 mport i0
+%0Aimport sys%0A
 %0A%0Afft = 
@@ -743,8 +743,457 @@
 olesky%0A%0A
+_restore_dict = %7B%7D%0A%0Adef register_func(name, func):%0A    if name not in __all__:%0A        raise ValueError, %22%25s not a dual function.%22 %25 name%0A    f = sys._getframe(0).f_globals%0A    _restore_dict%5Bname%5D = f%5Bname%5D%0A    f%5Bname%5D = func%0A%0Adef restore_func(name):%0A    if name not in __all__:%0A        raise ValueError, %22%25s not a dual function.%22 %25 name%0A    try:%0A        sys._getframe(0).f_globals%5Bname%5D = _restore_dict%5Bname%5D%0A    except KeyError:%0A        pass%0A    %0A

Use a register_func system for altering functions in numpy.dual