Giter Site home page Giter Site logo

scipy: if _is_safe_size(n): about ghost HOT 17 OPEN

jeremyNG-lab avatar jeremyNG-lab commented on June 16, 2024
scipy: if _is_safe_size(n):

from ghost.

Comments (17)

jchutrue avatar jchutrue commented on June 16, 2024

Hello,

What version of scipy are you using, and do you have a full traceback of the issue when you run the code?

from ghost.

jeremyNG-lab avatar jeremyNG-lab commented on June 16, 2024

I use scipy 1.3.0 but I had lot of problem with scipy like No module named....
What version you use?

from ghost.

jchutrue avatar jchutrue commented on June 16, 2024

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.

from ghost.

jeremyNG-lab avatar jeremyNG-lab commented on June 16, 2024

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
from scipy.misc import logsumexp
ImportError: cannot import name 'logsumexp' from 'scipy.misc' (C:\Users\jerem\anaconda3\lib\site-packages\scipy\misc_init
.py)_

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
import scipy.fftpack._fftpack as sff
ModuleNotFoundError: No module named 'scipy.fftpack.fftpack'

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 .

from ghost.

jchutrue avatar jchutrue commented on June 16, 2024

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.

from ghost.

ckemere avatar ckemere commented on June 16, 2024

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.

from ghost.

jchutrue avatar jchutrue commented on June 16, 2024

@jeremyNG-lab The errors should be gone now--let us know how it looks on your system

from ghost.

jeremyNG-lab avatar jeremyNG-lab commented on June 16, 2024

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_zfft_cache'

from ghost.

ckemere avatar ckemere commented on June 16, 2024

The master branch has been changed. Make sure you pip install it again?

from ghost.

jeremyNG-lab avatar jeremyNG-lab commented on June 16, 2024

I redownload and reinstall the package. But with scipy it didn't work, the same issue.

from ghost.

jchutrue avatar jchutrue commented on June 16, 2024

This might have something to do with scipy's legacy code. Try it now?

EDIT: i.e. run pip install again

from ghost.

jeremyNG-lab avatar jeremyNG-lab commented on June 16, 2024

INFO:ghost:'timestamps' not passed in; generating from data
WARNING:root:Module 'pyfftw' not found, using scipy backend
Traceback (most recent call last):

File "", line 2, in
cwt.transform(data =Accz, fs =10000, voices_per_octaveint=48) #, ,freqs=frevoices_per_octaveint=48 timestamps =Time, freq_limits =[10,401] ,

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'

from ghost.

jchutrue avatar jchutrue commented on June 16, 2024
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.

from ghost.

jeremyNG-lab avatar jeremyNG-lab commented on June 16, 2024

(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

from ghost.

jchutrue avatar jchutrue commented on June 16, 2024

If you instead install like so:

  1. pip3 uninstall ghost
  2. Navigate to the directory you want to place the cloned repo in.
  3. git clone https://github.com/nelpy/ghost.git
  4. cd ghost
  5. 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.

from ghost.

jeremyNG-lab avatar jeremyNG-lab commented on June 16, 2024

Yes it works.
Really Thanks

But with pyfftw it works everytime

from ghost.

jchutrue avatar jchutrue commented on June 16, 2024

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.

from ghost.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.