Skip to content

Clean up some wording in the fft extension #720

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 45 commits into from
Feb 8, 2024
Merged
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
c51ce80
Use better wording for the return dtypes for fft functions
asmeurer Dec 12, 2023
1dd9757
Specify the output shapes for fft functions
asmeurer Dec 12, 2023
bde524e
Fix typo for rfft return dtype
asmeurer Dec 12, 2023
1fd3429
Add specification for computing the cumulative sum
kgryte Dec 14, 2023
bda9c48
Add note clarifying behavior for out-of-bounds indices in `take`
kgryte Dec 14, 2023
50ca679
Add specifications for `maximum` and `minimum`
kgryte Dec 14, 2023
5c2423a
Fix definition of complex inner product in `vecdot` (#723)
mtsokol Dec 18, 2023
3295776
Update fft, ifft, fftn, ifftn, and hfft to only accept complex inputs
asmeurer Jan 10, 2024
72f86f3
Add `searchsorted` to the specification (#699)
kgryte Jan 11, 2024
8fe8b08
Fix sidebar contents under Extensions (#729)
rgommers Jan 11, 2024
7a56675
Update DLPack content to address unsupported use cases (#709)
rgommers Jan 12, 2024
7c3f99a
Backport fft language improvements to 2022.12
asmeurer Jan 12, 2024
62f95fd
Fix typo for hfft return dtype
asmeurer Jan 12, 2024
6e320d0
Add `clip` to the specification
kgryte Jan 22, 2024
0cde841
Clarify guidance in the "function and method signatures" section
rgommers Jan 22, 2024
293512d
Upgrade Sphinx version used in doc deployment (#735)
rgommers Jan 22, 2024
95332bb
Fix wording for comparison operators
hameerabbasi Jan 25, 2024
e9988f2
Fix the text for the output shape for (i)rfft(n)
asmeurer Feb 5, 2024
22fc23a
Add Optional type annotation for some parameters that can be None
asmeurer Feb 5, 2024
d4eebdf
back port optional type annotation
leofang Feb 7, 2024
86cc351
nits
leofang Feb 7, 2024
c4df0be
sync 2022 and draft
leofang Feb 7, 2024
6a2d6d0
nit: length of array "along" axis
leofang Feb 7, 2024
4d6e519
mention untransformed axes & align style
leofang Feb 7, 2024
35f2ea4
no more m
leofang Feb 7, 2024
a84c293
separately list the condition when s/n is None
leofang Feb 7, 2024
029afcd
Update language to be consistent with existing specification conventions
kgryte Feb 7, 2024
17124ba
Merge branch 'fft-fixes' of https://github.com/asmeurer/array-api int…
kgryte Feb 8, 2024
6d9fac4
Update copy for `fft`
kgryte Feb 8, 2024
66e9e29
Update copy
kgryte Feb 8, 2024
99cb776
Update copy for `ifft`
kgryte Feb 8, 2024
04a4e66
style: satisfy linting
kgryte Feb 8, 2024
9f208f6
Update copy for `fftn`
kgryte Feb 8, 2024
9a6fcc7
Update copy for `ifftn`
kgryte Feb 8, 2024
454ded7
Update copy
kgryte Feb 8, 2024
21e2840
Update copy for `rfft`
kgryte Feb 8, 2024
22d354a
Update copy for `irfft`
kgryte Feb 8, 2024
4d0160c
Update copy for `rfftn`
kgryte Feb 8, 2024
9d90326
Update copy for `irfftn`
kgryte Feb 8, 2024
8f2b6df
Update copy for `hfft`
kgryte Feb 8, 2024
43e96fa
Update copy for `ihfft`
kgryte Feb 8, 2024
c180034
Update copy
kgryte Feb 8, 2024
9f1c20e
Copy changes over to draft specification
kgryte Feb 8, 2024
b97bb34
Update copy
kgryte Feb 8, 2024
0a7df55
Fix indentation
kgryte Feb 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update copy for ifft
  • Loading branch information
kgryte committed Feb 8, 2024
commit 99cb7760ba9a5016457753df71f8c5e7d76d13ac
20 changes: 9 additions & 11 deletions src/array_api_stubs/_2022_12/fft.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def fft(

Default: ``None``.
axis: int
axis (dimension) of the input array over which to compute the Fourier transform. A valid ``axis`` must be an integer on the interval ``[-N, N)``, where ``N`` is the rank (number of dimensions) of ``x``. If an ``axis`` is specified as a negative integer, the function must determine the axis along which to compute the transform by counting backward from the last dimension (where ``-1`` refers to the last dimension). Default: ``-1``.
axis (dimension) of the input array over which to compute the transform. A valid ``axis`` must be an integer on the interval ``[-N, N)``, where ``N`` is the rank (number of dimensions) of ``x``. If an ``axis`` is specified as a negative integer, the function must determine the axis along which to compute the transform by counting backward from the last dimension (where ``-1`` refers to the last dimension). Default: ``-1``.
norm: Literal['backward', 'ortho', 'forward']
normalization mode. Should be one of the following modes:

Expand Down Expand Up @@ -79,24 +79,22 @@ def ifft(
Computes the one-dimensional inverse discrete Fourier transform.

.. note::
Applying the one-dimensional inverse discrete Fourier transform to the output of this function must return the original (i.e., non-transformed) input array within numerical accuracy (i.e., ``ifft(fft(x)) == x``), provided that the transform and inverse transform are performed with the same (length, axis, and normalization mode).
Applying the one-dimensional inverse discrete Fourier transform to the output of this function must return the original (i.e., non-transformed) input array within numerical accuracy (i.e., ``ifft(fft(x)) == x``), provided that the transform and inverse transform are performed with the same arguments (number of elements, axis, and normalization mode).

Parameters
----------
x: array
input array. Should have a complex-valued floating-point data type.
n: int
length of the transformed axis of the output. If
n: Optional[int]
number of elements in the transformed axis of the output array. Let ``M`` be the size of the input array array along the axis (dimension) specified by ``axis``. When ``n`` is ``None``, the function must set ``n`` equal to ``M``.

- ``n`` is greater than the length of the input array along ``axis``, the input array along ``axis`` is zero-padded to length ``n``.
- ``n`` is less than the length of the input array along ``axis``, the input array along ``axis`` is trimmed to length ``n``.
- ``n`` is not provided, the full length of the input array along ``axis`` must be used.
- If ``n`` is greater than ``M``, the axis specified by ``axis`` must be zero-padded to size ``n``.
- If ``n`` is less than ``M``, the axis specified by ``axis`` must be trimmed to size ``n``.
- If ``n`` equals ``M``, all elements along the axis specified by ``axis`` must be used when computing the transform.

Default: ``None``.
axis: int
axis (dimension) over which to compute the inverse Fourier transform. If not set, the last axis (dimension) is used.

Default: ``-1``.
axis (dimension) of the input array over which to compute the transform. A valid ``axis`` must be an integer on the interval ``[-N, N)``, where ``N`` is the rank (number of dimensions) of ``x``. If an ``axis`` is specified as a negative integer, the function must determine the axis along which to compute the transform by counting backward from the last dimension (where ``-1`` refers to the last dimension). Default: ``-1``.
norm: Literal['backward', 'ortho', 'forward']
normalization mode. Should be one of the following modes:

Expand All @@ -109,7 +107,7 @@ def ifft(
Returns
-------
out: array
an array transformed along the axis (dimension) indicated by ``axis``. The returned array must have the same data type as ``x``. The length along the transformed axis is ``n``, if given, or the length of the input along ``axis`` otherwise. The lengths along the un-transformed axes remain unchanged.
an array transformed along the axis (dimension) specified by ``axis``. The returned array must have the same data type as ``x`` and must have the same shape as ``x``, except for the axis specified by ``axis`` which must have size ``n``.

Notes
-----
Expand Down