8000 Clean up some wording in the fft extension by asmeurer · Pull Request #720 · data-apis/array-api · GitHub
[go: up one dir, main page]

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 fftn
  • Loading branch information
kgryte committed Feb 8, 2024
commit 9f208f65194d42a100c5e77f153f1e96a77ebc03
25 changes: 10 additions & 15 deletions src/array_api_stubs/_2022_12/fft.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def fft(
x: array
input array. Should have a complex-valued floating-point data type.
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``.
number of elements in the transformed axis of the output array. Let ``M`` be the size of the input array along the axis (dimension) specified by ``axis``. When ``n`` is ``None``, the function must set ``n`` equal to ``M``.

- 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``.
Expand Down Expand Up @@ -86,7 +86,7 @@ def ifft(
x: array
input array. Should have a complex-valued floating-point data type.
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``.
number of elements in the transformed axis of the output array. Let ``M`` be the size of the input array along the axis (dimension) specified by ``axis``. When ``n`` is ``None``, the function must set ``n`` equal to ``M``.

- 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``.
Expand Down Expand Up @@ -135,22 +135,17 @@ def fftn(
x: array
input array. Should have a complex-valued floating-point data type.
s: Optional[Sequence[int]]
length of each transformed axis of the output. If
number of elements in the transformed axes (dimensions) of the output array. Let ``i`` be the index of the nth axis specified by ``axes`` and ``M[i]`` be the size of the input array along axis ``i``. When ``s`` is ``None``, the function must set ``s`` equal to a sequence of integers, such that, for all ``i``, ``s[i]`` equals ``M[i]``.

- ``s[i]`` is greater than the length of the input array along the corresponding axis (dimension) ``i``, the input array along the axis ``i`` is zero-padded to length ``s[i]``.
- ``s[i]`` is less than the length of the input array along a corresponding axis (dimension) ``i``, the input array along the axis ``i`` is trimmed to length ``s[i]``.
- ``s[i]`` is ``-1``, the whole input array along the axis ``i`` is used (no padding/trimming).
- ``s`` is not provided, the length of each transformed axis (dimension) in the output array must equal the length of the corresponding axis in the input array.

If ``s`` is not ``None``, ``axes`` must not be ``None`` either, and ``s[i]`` corresponds to the length along the transformed axis specified by ``axes[i]``.
- If ``s[i]`` is greater than ``M[i]``, axis ``i`` must be zero-padded to size ``s[i]``.
- If ``s[i]`` is less than ``M[i]``, axis ``i`` must be trimmed to size ``s[i]``.
- If ``s[i]`` equals ``M[i]`` or ``-1``, all elements along axis ``i`` must be used when computing the transform.

Default: ``None``.
If ``s`` is not ``None``, ``axes`` must not be ``None``. Default: ``None``.
axes: Optional[Sequence[int]]
axes (dimensions) over which to compute the Fourier transform. If ``None``, all axes must be transformed.

If ``s`` is specified, the corresponding ``axes`` to be transformed must be explicitly specified too.
axes (dimensions) 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: ``None``.
If ``s`` is provided, the corresponding ``axes`` to be transformed must also be provided. If ``axes`` is ``None``, the function must compute the transform over all axes. Default: ``None``.
norm: Literal['backward', 'ortho', 'forward']
normalization mode. Should be one of the following modes:

Expand All @@ -165,7 +160,7 @@ def fftn(
Returns
-------
out: array
an array transformed along the axes (dimension) indicated by ``axes``. The returned array must have the same data type as ``x``. The length along each transformed axis ``i`` is ``s[i]``, if ``s`` is given and ``s[i]`` is not ``-1``, or the length of the corresponding axis of the input array otherwise. The lengths along the un-transformed axes remain unchanged.
an array transformed along the axes (dimensions) specified by ``axes``. The returned array must have the same data type as ``x`` and must have the same shape as ``x``, except for the axes specified by ``axes`` which must have size ``s[i]``.

Notes
-----
Expand Down
0