Open jeremyNG-lab opened 3 years ago
Hello,
What version of scipy are you using, and do you have a full traceback of the issue when you run the code?
I use scipy 1.3.0 but I had lot of problem with scipy like No module named.... What version you use?
I've been using pyfftw for the FFT backend. For scipy, if you have the full traceback of all your issues, I can take a look. Right now I'm not sure what the specific problems are.
So at the bigging I use the last scipy (1.6.0)
from . import morlet
File "......\anaconda3\lib\site-packages\ghost\wave\morlet.py", line 5, in
I changed in the file scipy.misc by scipy.special
_from .fourier import clean_scipy_cache
File ".....\anaconda3\lib\site-packages\ghost\sigtools\fourier.py", line 5, in
I changed by from scipy.fftpack import fft as sff
And I saw your last message that you use pyfftw so i installed this package and it works. I think that pyfftw must be installed for a good work .
The issue with scipy is that they removed some functions in later versions. I'll get around to fixing that today so that you can still use scipy as the fft backend if you want. But in general I do prefer to use pyfftw.
I think the two pull requests I proposed will fix these issues. But you should update the home page example to also import pyfftw
so that people do this by default.
@jeremyNG-lab The errors should be gone now--let us know how it looks on your system
Without the FFT backend I have the same issu:
_File "....\anaconda3\lib\site-packages\ghost\sigtools\fourier.py", line 11, in clean_scipy_cache sff.destroy_zfft_cache() AttributeError: 'function' object has no attribute 'destroy_zfftcache'
The master branch has been changed. Make sure you pip install it again?
I redownload and reinstall the package. But with scipy it didn't work, the same issue.
This might have something to do with scipy's legacy code. Try it now?
EDIT: i.e. run pip install
again
INFO:ghost:'timestamps' not passed in; generating from data WARNING:root:Module 'pyfftw' not found, using scipy backend Traceback (most recent call last):
File "
File "......\anaconda3\lib\site-packages\ghost\formats\preprocessing.py", line 187, in wrap_function return function(*args, **kwargs)
File "......\anaconda3\lib\site-packages\ghost\wave\transforms.py", line 224, in transform wavelet_conv((ii, freq, length))
File ".......\anaconda3\lib\site-packages\ghost\wave\transforms.py", line 203, in wavelet_conv res = convfun(input_asarray[..., start:stop], kernel)
File ".....\anaconda3\lib\site-packages\ghost\sigtools\convolution.py", line 81, in fastconv_scipy clean_scipy_cache()
File ".....\anaconda3\lib\site-packages\ghost\sigtools\fourier.py", line 11, in clean_scipy_cache sff.destroy_zfft_cache()
AttributeError: 'function' object has no attribute 'destroy_zfft_cache'
File ".....\anaconda3\lib\site-packages\ghost\sigtools\convolution.py", line 81, in fastconv_scipy
clean_scipy_cache()
File ".....\anaconda3\lib\site-packages\ghost\sigtools\fourier.py", line 11, in clean_scipy_cache
sff.destroy_zfft_cache()
AttributeError: 'function' object has no attribute 'destroy_zfft_cache'
Those two lines above no longer exist. You need to git pull
to update to the latest code and then run pip install
again.
(base) C:....>pip3 install git+https://github.com/nelpy/ghost.git Collecting git+https://github.com/nelpy/ghost.git Cloning https://github.com/nelpy/ghost.git to c:\users\jerem\appdata\local\temp\pip-req-build-syyxcccr Requirement already satisfied: numpy>=1.15.0 in c:\users\jerem\anaconda3\lib\site-packages (from ghost==0.0.0) (1.19.2) Requirement already satisfied: scipy>=1.0 in c:\users\jerem\anaconda3\lib\site-packages (from ghost==0.0.0) (1.6.0) Requirement already satisfied: matplotlib>=3.0 in c:\users\jerem\anaconda3\lib\site-packages (from ghost==0.0.0) (3.3.4) Requirement already satisfied: python-dateutil>=2.1 in c:\users\jerem\anaconda3\lib\site-packages (from matplotlib>=3.0->ghost==0.0.0) (2.8.1) Requirement already satisfied: kiwisolver>=1.0.1 in c:\users\jerem\anaconda3\lib\site-packages (from matplotlib>=3.0->ghost==0.0.0) (1.3.1) Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in c:\users\jerem\anaconda3\lib\site-packages (from matplotlib>=3.0->ghost==0.0.0) (2.4.7) Requirement already satisfied: cycler>=0.10 in c:\users\jerem\anaconda3\lib\site-packages (from matplotlib>=3.0->ghost==0.0.0) (0.10.0) Requirement already satisfied: pillow>=6.2.0 in c:\users\jerem\anaconda3\lib\site-packages (from matplotlib>=3.0->ghost==0.0.0) (8.1.0) Requirement already satisfied: six in c:\users\jerem\anaconda3\lib\site-packages (from cycler>=0.10->matplotlib>=3.0->ghost==0.0.0) (1.15.0)
I did it
I launched the script and I have the same error
If you instead install like so:
pip3 uninstall ghost
git clone https://github.com/nelpy/ghost.git
cd ghost
pip3 install .
and run your script, do you get the same error?
If you still have the error, try exporting your environment by running conda env export > environment.yml
. Then upload that file here and I'll try to reproduce the error on my machine.
Yes it works. Really Thanks
But with pyfftw it works everytime
Great! It should work fine on either scipy or fftw now. Let me know if you run into any further issues. If there aren't any related ones in the next couple of days, I'll close this one out.
Hi, This is my code with Accz and Time are array of float:
cwt = ContinuousWaveletTransform(wavelet= morse.Morse()) CPEF=cwt.transform(data =Accz, fs =1000, timestamps =Time, freq_limits =[0,300])
And the answer:
File ".......\lib\site-packages\scipy\fftpack\basic.py", line 87, in fft if _is_safe_size(n):
TypeError: c2c() missing 1 required keyword-only argument: 'plan'