Closed somenice closed 8 months ago
I've transferred this report to Learn.
ulab 5.0 (first in CircuitPython 8) made an incompatible change, so that spectrogram
is in ulab.utils
rather than ulab.scipy.signal
. The following examples need to be updated, and the guide text needs to be reviewed in case it should be updated as well:
EyeLights_Audio_Spectrum/EyeLights_Audio_Spectrum_CircuitPython/code.py:from ulab.scipy.signal import spectrogram
Feather_Sense_Audio_Visualizer_13x9_RGB_LED_Matrix/audio_spectrum_lightshow/code.py:from ulab.scipy.signal import spectrogram
Feather_Sense_Audio_Visualizer_13x9_RGB_LED_Matrix/waterfall_visualizer/code.py:from ulab.scipy.signal import spectrogram
Ukulele/code.py:from ulab.scipy.signal import spectrogram
ulab_Crunch_Numbers_Fast/waterfall/code.py:from ulab.scipy.signal import spectrogram
During the transitional period, where it's reasonable to accomodate using 7.3 and 8.x, I think the code should read
try:
from ulab.utils import spectrogram
except ImportError:
from ulab.scipy.signal import spectrogram
then the example should be tested using both 7.3 and 8.0.
@kattni is this one that eva could potentially take on?
Thank you for the quick fix @jepler
I can confirm from ulab.utils import spectrogram
works as intended.
ps. note the typo in code above except ImpotError:
thanks again
Thanks both for testing and noticing the typo!
@evaherrada Please add this to your list. You need to update the ulab utils import to the following:
try:
from ulab.utils import spectrogram
except ImportError:
from ulab.scipy.signal import spectrogram
If you have any questions, please reach out to @jepler in this thread. Thank you!
CircuitPython version
Code/REPL
Behavior
ImportError: can't import name spectrogram
Description
Had working example of this tutorial: https://learn.adafruit.com/mini-led-matrix-audio-visualizer Stopped working after latest update.
Additional information
From the repl >>> help(ulab.scipy.signal) shows only sosfilt function. None for scipy.signal.spectrogram