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

Fixes to the array-api stubs #806

Merged
merged 3 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 7 additions & 7 deletions src/array_api_stubs/_2022_12/fft.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def fft(
Parameters
----------
x: array
input array. Should have a complex-valued floating-point data type.
input array. Should have a complex floating-point data type.
n: Optional[int]
number of elements over which to compute the transform along the axis (dimension) specified by ``axis``. Let ``M`` be the size of the input array along the axis specified by ``axis``. When ``n`` is ``None``, the function must set ``n`` equal to ``M``.
Expand Down Expand Up @@ -84,7 +84,7 @@ def ifft(
Parameters
----------
x: array
input array. Should have a complex-valued floating-point data type.
input array. Should have a complex floating-point data type.
n: Optional[int]
number of elements over which to compute the transform along the axis (dimension) specified by ``axis``. Let ``M`` be the size of the input array along the axis specified by ``axis``. When ``n`` is ``None``, the function must set ``n`` equal to ``M``.
Expand Down Expand Up @@ -133,7 +133,7 @@ def fftn(
Parameters
----------
x: array
input array. Should have a complex-valued floating-point data type.
input array. Should have a complex floating-point data type.
s: Optional[Sequence[int]]
number of elements over which to compute the transform along the axes (dimensions) specified by ``axes``. Let ``i`` be the index of the ``n``-th axis specified by ``axes`` (i.e., ``i = axes[n]``) 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 ``s[i]`` equals ``M[i]`` for all ``i``.
Expand Down Expand Up @@ -188,7 +188,7 @@ def ifftn(
Parameters
----------
x: array
input array. Should have a complex-valued floating-point data type.
input array. Should have a complex floating-point data type.
s: Optional[Sequence[int]]
number of elements over which to compute the transform along the axes (dimensions) specified by ``axes``. Let ``i`` be the index of the ``n``-th axis specified by ``axes`` (i.e., ``i = axes[n]``) 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 ``s[i]`` equals ``M[i]`` for all ``i``.
Expand Down Expand Up @@ -292,7 +292,7 @@ def irfft(
Parameters
----------
x: array
input array. Should have a complex-valued floating-point data type.
input array. Should have a complex floating-point data type.
n: Optional[int]
number of elements along the transformed axis (dimension) specified by ``axis`` in the **output array**. Let ``M`` be the size of the input array along the axis specified by ``axis``. When ``n`` is ``None``, the function must set ``n`` equal to ``2*(M-1)``.
Expand Down Expand Up @@ -398,7 +398,7 @@ def irfftn(
Parameters
----------
x: array
input array. Should have a complex-valued floating-point data type.
input array. Should have a complex floating-point data type.
s: Optional[Sequence[int]]
number of elements along the transformed axes (dimensions) specified by ``axes`` in the **output array**. Let ``i`` be the index of the ``n``-th axis specified by ``axes`` (i.e., ``i = axes[n]``) 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 ``s[i]`` equals ``M[i]`` for all ``i``, except for the last transformed axis in which ``s[i]`` equals ``2*(M[i]-1)``. For each ``i``, let ``n`` equal ``s[i]``, except for the last transformed axis in which ``n`` equals ``s[i]//2+1``.
Expand Down Expand Up @@ -452,7 +452,7 @@ def hfft(
Parameters
----------
x: array
input array. Should have a complex-valued floating-point data type.
input array. Should have a complex floating-point data type.
n: Optional[int]
number of elements along the transformed axis (dimension) specified by ``axis`` in the **output array**. Let ``M`` be the size of the input array along the axis specified by ``axis``. When ``n`` is ``None``, the function must set ``n`` equal to ``2*(M-1)``.
Expand Down
2 changes: 1 addition & 1 deletion src/array_api_stubs/_2023_12/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from .utility_functions import *
from . import linalg
from . import fft
from . import info
from .info import __array_namespace_info__


__array_api_version__: str = "YYYY.MM"
Expand Down
14 changes: 6 additions & 8 deletions src/array_api_stubs/_2023_12/elementwise_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -874,14 +874,12 @@ def copysign(x1: array, x2: array, /) -> array:
- If ``x2_i`` is ``NaN`` and the sign bit of ``x2_i`` is ``1``, the result is ``-|x1_i|``.
- If ``x2_i`` is ``NaN`` and the sign bit of ``x2_i`` is ``0``, the result is ``|x1_i|``.
If ``x1_i`` is ``NaN``,
- If ``x2_i`` is less than ``0``, the result is ``NaN`` with a sign bit of ``1``.
- If ``x2_i`` is ``-0``, the result is ``NaN`` with a sign bit of ``1``.
- If ``x2_i`` is ``+0``, the result is ``NaN`` with a sign bit of ``0``.
- If ``x2_i`` is greater than ``0``, the result is ``NaN`` with a sign bit of ``0``.
- If ``x2_i`` is ``NaN`` and the sign bit of ``x2_i`` is ``1``, the result is ``NaN`` with a sign bit of ``1``.
- If ``x2_i`` is ``NaN`` and the sign bit of ``x2_i`` is ``0``, the result is ``NaN`` with a sign bit of ``0``.
- If ``x1_i`` is ``NaN`` and ``x2_i`` is less than ``0``, the result is ``NaN`` with a sign bit of ``1``.
- If ``x1_i`` is ``NaN`` and ``x2_i`` is ``-0``, the result is ``NaN`` with a sign bit of ``1``.
- If ``x1_i`` is ``NaN`` and ``x2_i`` is ``+0``, the result is ``NaN`` with a sign bit of ``0``.
- If ``x1_i`` is ``NaN`` and ``x2_i`` is greater than ``0``, the result is ``NaN`` with a sign bit of ``0``.
- If ``x1_i`` is ``NaN`` and ``x2_i`` is ``NaN`` and the sign bit of ``x2_i`` is ``1``, the result is ``NaN`` with a sign bit of ``1``.
- If ``x1_i`` is ``NaN`` and ``x2_i`` is ``NaN`` and the sign bit of ``x2_i`` is ``0``, the result is ``NaN`` with a sign bit of ``0``.
.. versionadded:: 2023.12
"""
Expand Down
24 changes: 12 additions & 12 deletions src/array_api_stubs/_2023_12/fft.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def fft(
Parameters
----------
x: array
input array. Should have a complex-valued floating-point data type.
input array. Should have a complex floating-point data type.
n: Optional[int]
number of elements over which to compute the transform along the axis (dimension) specified by ``axis``. Let ``M`` be the size of the input array along the axis specified by ``axis``. When ``n`` is ``None``, the function must set ``n`` equal to ``M``.
Expand Down Expand Up @@ -66,7 +66,7 @@ def fft(
.. versionadded:: 2022.12
.. versionchanged:: 2023.12
Required the input array have a complex-valued floating-point data type and required that the output array have the same data type as the input array.
Required the input array have a complex floating-point data type and required that the output array have the same data type as the input array.
"""


Expand All @@ -87,7 +87,7 @@ def ifft(
Parameters
----------
x: array
input array. Should have a complex-valued floating-point data type.
input array. Should have a complex floating-point data type.
n: Optional[int]
number of elements over which to compute the transform along the axis (dimension) specified by ``axis``. Let ``M`` be the size of the input array along the axis specified by ``axis``. When ``n`` is ``None``, the function must set ``n`` equal to ``M``.
Expand Down Expand Up @@ -118,7 +118,7 @@ def ifft(
.. versionadded:: 2022.12
.. versionchanged:: 2023.12
Required the input array have a complex-valued floating-point data type and required that the output array have the same data type as the input array.
Required the input array have a complex floating-point data type and required that the output array have the same data type as the input array.
"""


Expand All @@ -139,7 +139,7 @@ def fftn(
Parameters
----------
x: array
input array. Should have a complex-valued floating-point data type.
input array. Should have a complex floating-point data type.
s: Optional[Sequence[int]]
number of elements over which to compute the transform along the axes (dimensions) specified by ``axes``. Let ``i`` be the index of the ``n``-th axis specified by ``axes`` (i.e., ``i = axes[n]``) 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 ``s[i]`` equals ``M[i]`` for all ``i``.
Expand Down Expand Up @@ -176,7 +176,7 @@ def fftn(
.. versionadded:: 2022.12
.. versionchanged:: 2023.12
Required the input array have a complex-valued floating-point data type and required that the output array have the same data type as the input array.
Required the input array have a complex floating-point data type and required that the output array have the same data type as the input array.
"""


Expand All @@ -197,7 +197,7 @@ def ifftn(
Parameters
----------
x: array
input array. Should have a complex-valued floating-point data type.
input array. Should have a complex floating-point data type.
s: Optional[Sequence[int]]
number of elements over which to compute the transform along the axes (dimensions) specified by ``axes``. Let ``i`` be the index of the ``n``-th axis specified by ``axes`` (i.e., ``i = axes[n]``) 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 ``s[i]`` equals ``M[i]`` for all ``i``.
Expand Down Expand Up @@ -234,7 +234,7 @@ def ifftn(
.. versionadded:: 2022.12
.. versionchanged:: 2023.12
Required the input array have a complex-valued floating-point data type and required that the output array have the same data type as the input array.
Required the input array have a complex floating-point data type and required that the output array have the same data type as the input array.
"""


Expand Down Expand Up @@ -304,7 +304,7 @@ def irfft(
Parameters
----------
x: array
input array. Should have a complex-valued floating-point data type.
input array. Should have a complex floating-point data type.
n: Optional[int]
number of elements along the transformed axis (dimension) specified by ``axis`` in the **output array**. Let ``M`` be the size of the input array along the axis specified by ``axis``. When ``n`` is ``None``, the function must set ``n`` equal to ``2*(M-1)``.
Expand Down Expand Up @@ -413,7 +413,7 @@ def irfftn(
Parameters
----------
x: array
input array. Should have a complex-valued floating-point data type.
input array. Should have a complex floating-point data type.
s: Optional[Sequence[int]]
number of elements along the transformed axes (dimensions) specified by ``axes`` in the **output array**. Let ``i`` be the index of the ``n``-th axis specified by ``axes`` (i.e., ``i = axes[n]``) 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 ``s[i]`` equals ``M[i]`` for all ``i``, except for the last transformed axis in which ``s[i]`` equals ``2*(M[i]-1)``. For each ``i``, let ``n`` equal ``s[i]``, except for the last transformed axis in which ``n`` equals ``s[i]//2+1``.
Expand Down Expand Up @@ -470,7 +470,7 @@ def hfft(
Parameters
----------
x: array
input array. Should have a complex-valued floating-point data type.
input array. Should have a complex floating-point data type.
n: Optional[int]
number of elements along the transformed axis (dimension) specified by ``axis`` in the **output array**. Let ``M`` be the size of the input array along the axis specified by ``axis``. When ``n`` is ``None``, the function must set ``n`` equal to ``2*(M-1)``.
Expand Down Expand Up @@ -501,7 +501,7 @@ def hfft(
.. versionadded:: 2022.12
.. versionchanged:: 2023.12
Required the input array to have a complex-valued floating-point data type and required that the output array have a real-valued data type having the same precision as the input array.
Required the input array to have a complex floating-point data type and required that the output array have a real-valued data type having the same precision as the input array.
"""


Expand Down
2 changes: 1 addition & 1 deletion src/array_api_stubs/_draft/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from .utility_functions import *
from . import linalg
from . import fft
from . import info
from .info import __array_namespace_info__


__array_api_version__: str = "YYYY.MM"
Expand Down
14 changes: 6 additions & 8 deletions src/array_api_stubs/_draft/elementwise_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -875,14 +875,12 @@ def copysign(x1: array, x2: array, /) -> array:
- If ``x2_i`` is ``NaN`` and the sign bit of ``x2_i`` is ``1``, the result is ``-|x1_i|``.
- If ``x2_i`` is ``NaN`` and the sign bit of ``x2_i`` is ``0``, the result is ``|x1_i|``.
If ``x1_i`` is ``NaN``,
- If ``x2_i`` is less than ``0``, the result is ``NaN`` with a sign bit of ``1``.
- If ``x2_i`` is ``-0``, the result is ``NaN`` with a sign bit of ``1``.
- If ``x2_i`` is ``+0``, the result is ``NaN`` with a sign bit of ``0``.
- If ``x2_i`` is greater than ``0``, the result is ``NaN`` with a sign bit of ``0``.
- If ``x2_i`` is ``NaN`` and the sign bit of ``x2_i`` is ``1``, the result is ``NaN`` with a sign bit of ``1``.
- If ``x2_i`` is ``NaN`` and the sign bit of ``x2_i`` is ``0``, the result is ``NaN`` with a sign bit of ``0``.
- If ``x1_i`` is ``NaN`` and ``x2_i`` is less than ``0``, the result is ``NaN`` with a sign bit of ``1``.
- If ``x1_i`` is ``NaN`` and ``x2_i`` is ``-0``, the result is ``NaN`` with a sign bit of ``1``.
- If ``x1_i`` is ``NaN`` and ``x2_i`` is ``+0``, the result is ``NaN`` with a sign bit of ``0``.
- If ``x1_i`` is ``NaN`` and ``x2_i`` is greater than ``0``, the result is ``NaN`` with a sign bit of ``0``.
- If ``x1_i`` is ``NaN`` and ``x2_i`` is ``NaN`` and the sign bit of ``x2_i`` is ``1``, the result is ``NaN`` with a sign bit of ``1``.
- If ``x1_i`` is ``NaN`` and ``x2_i`` is ``NaN`` and the sign bit of ``x2_i`` is ``0``, the result is ``NaN`` with a sign bit of ``0``.
.. versionadded:: 2023.12
"""
Expand Down
Loading
Loading