[Matplotlib-users] ImportError: cannot import name inverse_fft

I can confirm this, using mpl svn2473 and numpy svn2603.

···

On Monday 12 June 2006 03:08, Nils Wagner wrote:

matplotlib data path /usr/lib64/python2.4/site-packages/matplotlib/mpl-data
$HOME=/home/nwagner
loaded rc file /home/nwagner/matplotlibrc
matplotlib version 0.87.3
verbose.level helpful
interactive is False
platform is linux2
numerix numpy 0.9.9.2603
Traceback (most recent call last):
  File "cascade.py", line 3, in ?
    from pylab import plot, show, xlim, ylim, subplot, xlabel, ylabel,
title, legend,savefig,clf,scatter
  File "/usr/lib64/python2.4/site-packages/pylab.py", line 1, in ?
    from matplotlib.pylab import *
  File "/usr/lib64/python2.4/site-packages/matplotlib/pylab.py", line
198, in ?
    import mlab #so I can override hist, psd, etc...
  File "/usr/lib64/python2.4/site-packages/matplotlib/mlab.py", line 74,
in ?
    from numerix.fft import fft, inverse_fft
ImportError: cannot import name inverse_fft

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Darren S. Dale, Ph.D.
Cornell High Energy Synchrotron Source
Cornell University
200L Wilson Lab
Rt. 366 & Pine Tree Road
Ithaca, NY 14853

dd55@...143...
office: (607) 255-9894
fax: (607) 255-9001

It looks like NumPy renamed inverse_fft to ifft. Adding the following to the
numpy block in lib/matplotlib/numerix/fft/__init__.py lets me run pylab
again:

    from numpy.dft import *
    inverse_fft = ifft

Should I commit this?

Darren

···

On Monday 12 June 2006 11:02, Darren Dale wrote:

I can confirm this, using mpl svn2473 and numpy svn2603.

On Monday 12 June 2006 03:08, Nils Wagner wrote:
> matplotlib data path
> /usr/lib64/python2.4/site-packages/matplotlib/mpl-data
> $HOME=/home/nwagner
> loaded rc file /home/nwagner/matplotlibrc
> matplotlib version 0.87.3
> verbose.level helpful
> interactive is False
> platform is linux2
> numerix numpy 0.9.9.2603
> Traceback (most recent call last):
> File "cascade.py", line 3, in ?
> from pylab import plot, show, xlim, ylim, subplot, xlabel, ylabel,
> title, legend,savefig,clf,scatter
> File "/usr/lib64/python2.4/site-packages/pylab.py", line 1, in ?
> from matplotlib.pylab import *
> File "/usr/lib64/python2.4/site-packages/matplotlib/pylab.py", line
> 198, in ?
> import mlab #so I can override hist, psd, etc...
> File "/usr/lib64/python2.4/site-packages/matplotlib/mlab.py", line 74,
> in ?
> from numerix.fft import fft, inverse_fft
> ImportError: cannot import name inverse_fft

Darren Dale wrote:

I can confirm this, using mpl svn2473 and numpy svn2603.

matplotlib data path
/usr/lib64/python2.4/site-packages/matplotlib/mpl-data
$HOME=/home/nwagner
loaded rc file /home/nwagner/matplotlibrc
matplotlib version 0.87.3
verbose.level helpful
interactive is False
platform is linux2
numerix numpy 0.9.9.2603
Traceback (most recent call last):
File "cascade.py", line 3, in ?
   from pylab import plot, show, xlim, ylim, subplot, xlabel, ylabel,
title, legend,savefig,clf,scatter
File "/usr/lib64/python2.4/site-packages/pylab.py", line 1, in ?
   from matplotlib.pylab import *
File "/usr/lib64/python2.4/site-packages/matplotlib/pylab.py", line
198, in ?
   import mlab #so I can override hist, psd, etc...
File "/usr/lib64/python2.4/site-packages/matplotlib/mlab.py", line 74,
in ?
   from numerix.fft import fft, inverse_fft
ImportError: cannot import name inverse_fft
     
It looks like NumPy renamed inverse_fft to ifft. Adding the following to the numpy block in lib/matplotlib/numerix/fft/__init__.py lets me run pylab again:

   from numpy.dft import *
   inverse_fft = ifft

The ifft name has been there for a while. Recently though, I moved the old interface to numpy.dft.old (similar to what was done for linalg). This is in an effort to distinguish between backwards_compatible names and "currently used" names.

I've committed a change that imports all the old names to the numerix interface. I didn't see any use besides inverse_fft, but I figure others who use the numerix interface may have been using more names so I imported all of them.

Sorry, I didn't catch this sooner.

-Travis

···

On Monday 12 June 2006 11:02, Darren Dale wrote:

On Monday 12 June 2006 03:08, Nils Wagner wrote: