scipy/legacy-signal
| Rule | legacy-signal |
|---|---|
| Pack | SciPy |
| Severity | info |
| Fix | safe, with xpd check --fix |
| Library versions | every version |
SciPy marks signal.stft, spectrogram and similar functions as legacy. Use a ShortTimeFFT object and its method of the same purpose.
w, h = signal.sosfreqz(sos, worN=512)w, h = signal.freqz_sos(sos, worN=512)What the rule reports
Section titled “What the rule reports”The rule reports signal.stft, istft, spectrogram and check_COLA, which SciPy marks as
legacy in favor of the ShortTimeFFT class. It also reports signal.sosfreqz, a legacy alias
of freqz_sos, but not on SciPy older than 1.15.
How to fix it
Section titled “How to fix it”xpd check --fix applies the fix of this rule.
The safe fix writes freqz_sos for sosfreqz, whose body only calls freqz_sos. The other forms have no fix.
Message
Section titled “Message”xpd prints this message with the issue. A name that starts with $ stands for code from your file.
SciPy marks signal.$F as a legacy function. Write a ShortTimeFFT object and call its method of the same purpose, such as stft or spectrogram.Browse the other rules of the SciPy pack.