windows.py 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. # This file is not meant for public use and will be removed in SciPy v2.0.0.
  2. # Use the `scipy.signal.windows` namespace for importing the functions
  3. # included below.
  4. import warnings
  5. from . import _windows
  6. __all__ = [ # noqa: F822
  7. 'boxcar', 'triang', 'parzen', 'bohman', 'blackman', 'nuttall',
  8. 'blackmanharris', 'flattop', 'bartlett', 'barthann',
  9. 'hamming', 'kaiser', 'gaussian', 'general_cosine',
  10. 'general_gaussian', 'general_hamming', 'chebwin', 'cosine',
  11. 'hann', 'exponential', 'tukey', 'taylor', 'dpss', 'get_window',
  12. 'linalg', 'sp_fft', 'k', 'v', 'key'
  13. ]
  14. def __dir__():
  15. return __all__
  16. def __getattr__(name):
  17. if name not in __all__:
  18. raise AttributeError(
  19. "scipy.signal.windows.windows is deprecated and has no attribute "
  20. f"{name}. Try looking in scipy.signal.windows instead.")
  21. warnings.warn(f"Please use `{name}` from the `scipy.signal.windows` namespace, "
  22. "the `scipy.signal.windows.windows` namespace is deprecated.",
  23. category=DeprecationWarning, stacklevel=2)
  24. return getattr(_windows, name)