Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Cannot import neurodsp.timefrequency with latest SciPy 1.15 #346

Open
larsoner opened this issue Jan 7, 2025 · 2 comments
Open

BUG: Cannot import neurodsp.timefrequency with latest SciPy 1.15 #346

larsoner opened this issue Jan 7, 2025 · 2 comments

Comments

@larsoner
Copy link

larsoner commented Jan 7, 2025

scipy.signal.morlet has been removed so you get for example:

  File "/Applications/MNE-Python/1.9.0_0/.mne-python/lib/python3.12/site-packages/bycycle/features/shape.py", line 6, in <module>
    from neurodsp.timefrequency import amp_by_time
  File "/Applications/MNE-Python/1.9.0_0/.mne-python/lib/python3.12/site-packages/neurodsp/timefrequency/__init__.py", line 4, in <module>
    from .wavelets import compute_wavelet_transform, convolve_wavelet
  File "/Applications/MNE-Python/1.9.0_0/.mne-python/lib/python3.12/site-packages/neurodsp/timefrequency/wavelets.py", line 4, in <module>
    from scipy.signal import morlet
ImportError: cannot import name 'morlet' from 'scipy.signal' (/Applications/MNE-Python/1.9.0_0/.mne-python/lib/python3.12/site-packages/scipy/signal/__init__.py)
Error: Process completed with exit code 1.

Eventually you might want a good long-term solution, but for now I'd suggest perhaps just to vendor the old code. I can open a quick PR to do that if it would help.

@TomDonoghue
Copy link
Member

Ah, I saw this would be coming in #325 but didn't keep track of the timeline.

We haven't made any decision on how to manage this yet - I'm curious on @ryanhammonds thoughts? We could vendor in the scipy code, though I'm not sure we want to do that long term. Maybe we should simply drop support for wavelets - what we have is very minimal anyways, and since I'm not sure we want to try to support / extend wavelet functionality, perhaps we should point people towards pywavelets, like scipy does now.

@ryanhammonds
Copy link
Member

ryanhammonds commented Jan 13, 2025

I don't have a strong opinion. I've never used wavelets from neurodsp, so it wouldn't bother me to deprecate and have an error that directs to pywavelets. But also don't want to deprecate if it's commonly used. I'm unsure how to gauge how much it's used. I think @mwprestonjr may use wavelets or maybe it was multi-tapers? A solution was also proposed in #344 by @noortasnim (edit: actually that looks like it's for a separate scipy deprecation). I'm happy to review a fix for this if someone wants to put a PR together. Otherwise I can make a PR deprecating it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants