scipy/legacy-fftpack
| Rule | legacy-fftpack |
|---|---|
| Pack | SciPy |
| Severity | info |
| Fix | none, edit by hand |
| Library versions | every version |
scipy.fftpack is legacy, and SciPy says new code should use scipy.fft. Import from scipy.fft, and check rfft, whose output layout differs.
from scipy import fftpacky = fftpack.dct(x)from scipy import ffty = fft.dct(x)What the rule reports
Section titled “What the rule reports”The rule reports an import of scipy.fftpack, whose module docstring marks it as legacy and
says new code should use scipy.fft. scipy.fft was no faster in the measurements, so the rule
claims only the preference.
How to fix it
Section titled “How to fix it”xpd has no automatic fix. Because rfft packs its output differently and the pseudo differential operators have no scipy.fft form. Make the change by hand.
Message
Section titled “Message”xpd prints this message with the issue. A name that starts with $ stands for code from your file.
scipy.fftpack is legacy, and its SciPy docstring says new code should use scipy.fft. Import from scipy.fft instead, and check rfft, whose output layout differs.Browse the other rules of the SciPy pack.