Skip to content

Commit

Permalink
Merge pull request #25536 from mhvk/fft-as-gufunc
Browse files Browse the repository at this point in the history
MAINT, ENH: Implement calling pocketfft via gufunc and allow out argument
  • Loading branch information
seberg committed Jan 19, 2024
2 parents 72879d3 + 570f272 commit 539dafa
Show file tree
Hide file tree
Showing 8 changed files with 739 additions and 272 deletions.
206 changes: 149 additions & 57 deletions numpy/fft/_pocketfft.py

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions numpy/fft/_pocketfft.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,31 @@ def fft(
n: None | int = ...,
axis: int = ...,
norm: _NormKind = ...,
out: None | NDArray[complex128] = ...,
) -> NDArray[complex128]: ...

def ifft(
a: ArrayLike,
n: None | int = ...,
axis: int = ...,
norm: _NormKind = ...,
out: None | NDArray[complex128] = ...,
) -> NDArray[complex128]: ...

def rfft(
a: ArrayLike,
n: None | int = ...,
axis: int = ...,
norm: _NormKind = ...,
out: None | NDArray[complex128] = ...,
) -> NDArray[complex128]: ...

def irfft(
a: ArrayLike,
n: None | int = ...,
axis: int = ...,
norm: _NormKind = ...,
out: None | NDArray[float64] = ...,
) -> NDArray[float64]: ...

# Input array must be compatible with `np.conjugate`
Expand All @@ -42,67 +46,77 @@ def hfft(
n: None | int = ...,
axis: int = ...,
norm: _NormKind = ...,
out: None | NDArray[float64] = ...,
) -> NDArray[float64]: ...

def ihfft(
a: ArrayLike,
n: None | int = ...,
axis: int = ...,
norm: _NormKind = ...,
out: None | NDArray[complex128] = ...,
) -> NDArray[complex128]: ...

def fftn(
a: ArrayLike,
s: None | Sequence[int] = ...,
axes: None | Sequence[int] = ...,
norm: _NormKind = ...,
out: None | NDArray[complex128] = ...,
) -> NDArray[complex128]: ...

def ifftn(
a: ArrayLike,
s: None | Sequence[int] = ...,
axes: None | Sequence[int] = ...,
norm: _NormKind = ...,
out: None | NDArray[complex128] = ...,
) -> NDArray[complex128]: ...

def rfftn(
a: ArrayLike,
s: None | Sequence[int] = ...,
axes: None | Sequence[int] = ...,
norm: _NormKind = ...,
out: None | NDArray[complex128] = ...,
) -> NDArray[complex128]: ...

def irfftn(
a: ArrayLike,
s: None | Sequence[int] = ...,
axes: None | Sequence[int] = ...,
norm: _NormKind = ...,
out: None | NDArray[float64] = ...,
) -> NDArray[float64]: ...

def fft2(
a: ArrayLike,
s: None | Sequence[int] = ...,
axes: None | Sequence[int] = ...,
norm: _NormKind = ...,
out: None | NDArray[complex128] = ...,
) -> NDArray[complex128]: ...

def ifft2(
a: ArrayLike,
s: None | Sequence[int] = ...,
axes: None | Sequence[int] = ...,
norm: _NormKind = ...,
out: None | NDArray[complex128] = ...,
) -> NDArray[complex128]: ...

def rfft2(
a: ArrayLike,
s: None | Sequence[int] = ...,
axes: None | Sequence[int] = ...,
norm: _NormKind = ...,
out: None | NDArray[complex128] = ...,
) -> NDArray[complex128]: ...

def irfft2(
a: ArrayLike,
s: None | Sequence[int] = ...,
axes: None | Sequence[int] = ...,
norm: _NormKind = ...,
out: None | NDArray[float64] = ...,
) -> NDArray[float64]: ...
Loading

0 comments on commit 539dafa

Please sign in to comment.