helper.py 610 B

12345678910111213141516
  1. def __getattr__(attr_name):
  2. import warnings
  3. from numpy.fft import _helper
  4. ret = getattr(_helper, attr_name, None)
  5. if ret is None:
  6. raise AttributeError(
  7. f"module 'numpy.fft.helper' has no attribute {attr_name}")
  8. warnings.warn(
  9. "The numpy.fft.helper has been made private and renamed to "
  10. "numpy.fft._helper. All four functions exported by it (i.e. fftshift, "
  11. "ifftshift, fftfreq, rfftfreq) are available from numpy.fft. "
  12. f"Please use numpy.fft.{attr_name} instead.",
  13. DeprecationWarning,
  14. stacklevel=3
  15. )
  16. return ret