Skip to content
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

Clean up some wording in the fft extension #720

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
28 changes: 14 additions & 14 deletions src/array_api_stubs/_draft/fft.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def fft(
Returns
-------
out: array
an array transformed along the axis (dimension) indicated by ``axis``. The returned array must have a complex floating-point data type determined by :ref:`type-promotion`.
an array transformed along the axis (dimension) indicated by ``axis``. If ``x`` has a complex floating-point data type, the returned array must have the same data type as ``x``. If ``x`` has a real-valued floating-point data type, the returned array must have a complex floating-point data type whose precision matches the precision of ``x`` (e.g., if ``x`` is ``float64``, then the returned array must have a ``complex128`` data type).
leofang marked this conversation as resolved.
Show resolved Hide resolved

Notes
-----
Expand Down Expand Up @@ -111,7 +111,7 @@ def ifft(
Returns
-------
out: array
an array transformed along the axis (dimension) indicated by ``axis``. The returned array must have a complex floating-point data type determined by :ref:`type-promotion`.
an array transformed along the axis (dimension) indicated by ``axis``. If ``x`` has a complex floating-point data type, the returned array must have the same data type as ``x``. If ``x`` has a real-valued floating-point data type, the returned array must have a complex floating-point data type whose precision matches the precision of ``x`` (e.g., if ``x`` is ``float64``, then the returned array must have a ``complex128`` data type).

Notes
-----
Expand Down Expand Up @@ -169,7 +169,7 @@ def fftn(
Returns
-------
out: array
an array transformed along the axes (dimension) indicated by ``axes``. The returned array must have a complex floating-point data type determined by :ref:`type-promotion`.
an array transformed along the axes (dimension) indicated by ``axes``. If ``x`` has a complex floating-point data type, the returned array must have the same data type as ``x``. If ``x`` has a real-valued floating-point data type, the returned array must have a complex floating-point data type whose precision matches the precision of ``x`` (e.g., if ``x`` is ``float64``, then the returned array must have a ``complex128`` data type).

Notes
-----
Expand Down Expand Up @@ -227,7 +227,7 @@ def ifftn(
Returns
-------
out: array
an array transformed along the axes (dimension) indicated by ``axes``. The returned array must have a complex floating-point data type determined by :ref:`type-promotion`.
an array transformed along the axes (dimension) indicated by ``axes``. If ``x`` has a complex floating-point data type, the returned array must have the same data type as ``x``. If ``x`` has a real-valued floating-point data type, the returned array must have a complex floating-point data type whose precision matches the precision of ``x`` (e.g., if ``x`` is ``float64``, then the returned array must have a ``complex128`` data type).

Notes
-----
Expand Down Expand Up @@ -278,7 +278,7 @@ def rfft(
Returns
-------
out: array
an array transformed along the axis (dimension) indicated by ``axis``. The returned array must have a complex-valued floating-point data type determined by :ref:`type-promotion`.
an array transformed along the axis (dimension) indicated by ``axis``. The returned array must have a complex floating-point data type whose precision matches the precision of ``x`` (e.g., if ``x`` is ``float64``, then the returned array must have a ``complex128`` data type).

Notes
-----
Expand Down Expand Up @@ -329,7 +329,7 @@ def irfft(
Returns
-------
out: array
an array transformed along the axis (dimension) indicated by ``axis``. The returned array must have a real-valued floating-point data type determined by :ref:`type-promotion`. The length along the transformed axis is ``n`` (if given) or ``2*(m-1)`` (otherwise).
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 ``2*(m-1)`` (otherwise).
leofang marked this conversation as resolved.
Show resolved Hide resolved

Notes
-----
Expand Down Expand Up @@ -387,7 +387,7 @@ def rfftn(
Returns
-------
out: array
an array transformed along the axes (dimension) indicated by ``axes``. The returned array must have a complex-valued floating-point data type determined by :ref:`type-promotion`.
an array transformed along the axes (dimension) indicated by ``axes``. The returned array must have a complex floating-point data type whose precision matches the precision of ``x`` (e.g., if ``x`` is ``float64``, then the returned array must have a ``complex128`` data type).

Notes
-----
Expand Down Expand Up @@ -445,7 +445,7 @@ def irfftn(
Returns
-------
out: array
an array transformed along the axes (dimension) indicated by ``axes``. The returned array must have a real-valued floating-point data type determined by :ref:`type-promotion`. The length along the last transformed axis is ``s[-1]`` (if given) or ``2*(m - 1)`` (otherwise), and all other axes ``s[i]``.
an array transformed along the axes (dimension) indicated by ``axes``. The returned array must have a real-valued floating-point data type whose precision matches the precision of ``x`` (e.g., if ``x`` is ``complex128``, then the returned array must have a ``float64`` data type). The length along the last transformed axis is ``s[-1]`` (if given) or ``2*(m - 1)`` (otherwise), and all other axes ``s[i]``.

Notes
-----
Expand Down Expand Up @@ -493,7 +493,7 @@ def hfft(
Returns
-------
out: array
an array transformed along the axis (dimension) indicated by ``axis``. The returned array must have a real-valued floating-point data type determined by :ref:`type-promotion`.
an array transformed along the axis (dimension) indicated by ``axis``. If ``x`` has a complex floating-point data type, the returned array must have the same data type as ``x``. If ``x`` has a real-valued floating-point data type, the returned array must have a complex floating-point data type whose precision matches the precision of ``x`` (e.g., if ``x`` is ``float64``, then the returned array must have a ``complex128`` data type).

Notes
-----
Expand Down Expand Up @@ -541,7 +541,7 @@ def ihfft(
Returns
-------
out: array
an array transformed along the axis (dimension) indicated by ``axis``. The returned array must have a complex-valued floating-point data type determined by :ref:`type-promotion`.
an array transformed along the axis (dimension) indicated by ``axis``. The returned array must have a complex floating-point data type whose precision matches the precision of ``x`` (e.g., if ``x`` is ``float64``, then the returned array must have a ``complex128`` data type).

Notes
-----
Expand All @@ -552,7 +552,7 @@ def ihfft(

def fftfreq(n: int, /, *, d: float = 1.0, device: Optional[device] = None) -> array:
"""
Returns the discrete Fourier transform sample frequencies.
Computes the discrete Fourier transform sample frequencies.

For a Fourier transform of length ``n`` and length unit of ``d`` the frequencies are described as:

Expand All @@ -573,7 +573,7 @@ def fftfreq(n: int, /, *, d: float = 1.0, device: Optional[device] = None) -> ar
Returns
-------
out: array
an array of length ``n`` containing the sample frequencies. The returned array must have a real-valued floating-point data type determined by :ref:`type-promotion`.
an array of length ``n`` containing the sample frequencies. The returned array must have the default real-valued floating-point data type.

Notes
-----
Expand All @@ -584,7 +584,7 @@ def fftfreq(n: int, /, *, d: float = 1.0, device: Optional[device] = None) -> ar

def rfftfreq(n: int, /, *, d: float = 1.0, device: Optional[device] = None) -> array:
"""
Returns the discrete Fourier transform sample frequencies (for ``rfft`` and ``irfft``).
Computes the discrete Fourier transform sample frequencies (for ``rfft`` and ``irfft``).

For a Fourier transform of length ``n`` and length unit of ``d`` the frequencies are described as:

Expand All @@ -607,7 +607,7 @@ def rfftfreq(n: int, /, *, d: float = 1.0, device: Optional[device] = None) -> a
Returns
-------
out: array
an array of length ``n//2+1`` containing the sample frequencies. The returned array must have a real-valued floating-point data type determined by :ref:`type-promotion`.
an array of length ``n//2+1`` containing the sample frequencies. The returned array must have the default real-valued floating-point data type.

Notes
-----
Expand Down