helper.pyi 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. from typing import Any, TypeVar, overload
  2. from numpy import generic, integer, floating, complexfloating
  3. from numpy._typing import (
  4. NDArray,
  5. ArrayLike,
  6. _ShapeLike,
  7. _ArrayLike,
  8. _ArrayLikeFloat_co,
  9. _ArrayLikeComplex_co,
  10. )
  11. _SCT = TypeVar("_SCT", bound=generic)
  12. __all__: list[str]
  13. @overload
  14. def fftshift(x: _ArrayLike[_SCT], axes: None | _ShapeLike = ...) -> NDArray[_SCT]: ...
  15. @overload
  16. def fftshift(x: ArrayLike, axes: None | _ShapeLike = ...) -> NDArray[Any]: ...
  17. @overload
  18. def ifftshift(x: _ArrayLike[_SCT], axes: None | _ShapeLike = ...) -> NDArray[_SCT]: ...
  19. @overload
  20. def ifftshift(x: ArrayLike, axes: None | _ShapeLike = ...) -> NDArray[Any]: ...
  21. @overload
  22. def fftfreq(
  23. n: int | integer[Any],
  24. d: _ArrayLikeFloat_co = ...,
  25. ) -> NDArray[floating[Any]]: ...
  26. @overload
  27. def fftfreq(
  28. n: int | integer[Any],
  29. d: _ArrayLikeComplex_co = ...,
  30. ) -> NDArray[complexfloating[Any, Any]]: ...
  31. @overload
  32. def rfftfreq(
  33. n: int | integer[Any],
  34. d: _ArrayLikeFloat_co = ...,
  35. ) -> NDArray[floating[Any]]: ...
  36. @overload
  37. def rfftfreq(
  38. n: int | integer[Any],
  39. d: _ArrayLikeComplex_co = ...,
  40. ) -> NDArray[complexfloating[Any, Any]]: ...