spectral.py 944 B

1234567891011121314151617181920212223242526272829303132
  1. # This file is not meant for public use and will be removed in SciPy v2.0.0.
  2. # Use the `scipy.signal` namespace for importing the functions
  3. # included below.
  4. import warnings
  5. from . import _spectral_py
  6. __all__ = [ # noqa: F822
  7. 'periodogram', 'welch', 'lombscargle', 'csd', 'coherence',
  8. 'spectrogram', 'stft', 'istft', 'check_COLA', 'check_NOLA',
  9. 'sp_fft', 'get_window', 'const_ext', 'even_ext',
  10. 'odd_ext', 'zero_ext'
  11. ]
  12. def __dir__():
  13. return __all__
  14. def __getattr__(name):
  15. if name not in __all__:
  16. raise AttributeError(
  17. "scipy.signal.spectral is deprecated and has no attribute "
  18. f"{name}. Try looking in scipy.signal instead.")
  19. warnings.warn(f"Please use `{name}` from the `scipy.signal` namespace, "
  20. "the `scipy.signal.spectral` namespace is deprecated.",
  21. category=DeprecationWarning, stacklevel=2)
  22. return getattr(_spectral_py, name)