Skip to content

Commit 56064e7

Browse files
committed
Merge branch 'main' of https://github.com/data-apis/array-api into feat/broadcast_shapes
2 parents 9fd0a74 + 41f9880 commit 56064e7

14 files changed

Lines changed: 190 additions & 37 deletions

spec/draft/API_specification/set_functions.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Objects in API
1818
:toctree: generated
1919
:template: method.rst
2020

21+
isin
2122
unique_all
2223
unique_counts
2324
unique_inverse

src/array_api_stubs/_2021_12/manipulation_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def concat(
2424
"""
2525

2626

27-
def expand_dims(x: array, /, *, axis: int = 0) -> array:
27+
def expand_dims(x: array, /, axis: int) -> array:
2828
"""
2929
Expands the shape of an array by inserting a new axis (dimension) of size one at the position specified by ``axis``.
3030

src/array_api_stubs/_2022_12/elementwise_functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2290,8 +2290,8 @@ def sqrt(x: array, /) -> array:
22902290
- If ``a`` is either ``+0`` or ``-0`` and ``b`` is ``+0``, the result is ``+0 + 0j``.
22912291
- If ``a`` is any value (including ``NaN``) and ``b`` is ``+infinity``, the result is ``+infinity + infinity j``.
22922292
- If ``a`` is a finite number and ``b`` is ``NaN``, the result is ``NaN + NaN j``.
2293-
- If ``a`` ``-infinity`` and ``b`` is a positive (i.e., greater than ``0``) finite number, the result is ``NaN + NaN j``.
2294-
- If ``a`` is ``+infinity`` and ``b`` is a positive (i.e., greater than ``0``) finite number, the result is ``+0 + infinity j``.
2293+
- If ``a`` ``-infinity`` and ``b`` is a positive (i.e., greater than ``0``) finite number, the result is ``+0 + infinity j``.
2294+
- If ``a`` is ``+infinity`` and ``b`` is a positive (i.e., greater than ``0``) finite number, the result is ``+infinity + 0 j``.
22952295
- If ``a`` is ``-infinity`` and ``b`` is ``NaN``, the result is ``NaN + infinity j`` (sign of the imaginary component is unspecified).
22962296
- If ``a`` is ``+infinity`` and ``b`` is ``NaN``, the result is ``+infinity + NaN j``.
22972297
- If ``a`` is ``NaN`` and ``b`` is any value, the result is ``NaN + NaN j``.

src/array_api_stubs/_2022_12/manipulation_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def concat(
5858
"""
5959

6060

61-
def expand_dims(x: array, /, *, axis: int = 0) -> array:
61+
def expand_dims(x: array, /, axis: int) -> array:
6262
"""
6363
Expands the shape of an array by inserting a new axis (dimension) of size one at the position specified by ``axis``.
6464

src/array_api_stubs/_2023_12/elementwise_functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2598,8 +2598,8 @@ def sqrt(x: array, /) -> array:
25982598
- If ``a`` is either ``+0`` or ``-0`` and ``b`` is ``+0``, the result is ``+0 + 0j``.
25992599
- If ``a`` is any value (including ``NaN``) and ``b`` is ``+infinity``, the result is ``+infinity + infinity j``.
26002600
- If ``a`` is a finite number and ``b`` is ``NaN``, the result is ``NaN + NaN j``.
2601-
- If ``a`` ``-infinity`` and ``b`` is a positive (i.e., greater than ``0``) finite number, the result is ``NaN + NaN j``.
2602-
- If ``a`` is ``+infinity`` and ``b`` is a positive (i.e., greater than ``0``) finite number, the result is ``+0 + infinity j``.
2601+
- If ``a`` ``-infinity`` and ``b`` is a positive (i.e., greater than ``0``) finite number, the result is ``+0 + infinity j``.
2602+
- If ``a`` is ``+infinity`` and ``b`` is a positive (i.e., greater than ``0``) finite number, the result is ``+infinity + 0 j``.
26032603
- If ``a`` is ``-infinity`` and ``b`` is ``NaN``, the result is ``NaN + infinity j`` (sign of the imaginary component is unspecified).
26042604
- If ``a`` is ``+infinity`` and ``b`` is ``NaN``, the result is ``+infinity + NaN j``.
26052605
- If ``a`` is ``NaN`` and ``b`` is any value, the result is ``NaN + NaN j``.

src/array_api_stubs/_2023_12/manipulation_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def concat(
7676
"""
7777

7878

79-
def expand_dims(x: array, /, *, axis: int = 0) -> array:
79+
def expand_dims(x: array, /, axis: int) -> array:
8080
"""
8181
Expands the shape of an array by inserting a new axis (dimension) of size one at the position specified by ``axis``.
8282

src/array_api_stubs/_2024_12/elementwise_functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2872,8 +2872,8 @@ def sqrt(x: array, /) -> array:
28722872
- If ``a`` is either ``+0`` or ``-0`` and ``b`` is ``+0``, the result is ``+0 + 0j``.
28732873
- If ``a`` is any value (including ``NaN``) and ``b`` is ``+infinity``, the result is ``+infinity + infinity j``.
28742874
- If ``a`` is a finite number and ``b`` is ``NaN``, the result is ``NaN + NaN j``.
2875-
- If ``a`` ``-infinity`` and ``b`` is a positive (i.e., greater than ``0``) finite number, the result is ``NaN + NaN j``.
2876-
- If ``a`` is ``+infinity`` and ``b`` is a positive (i.e., greater than ``0``) finite number, the result is ``+0 + infinity j``.
2875+
- If ``a`` ``-infinity`` and ``b`` is a positive (i.e., greater than ``0``) finite number, the result is ``+0 + infinity j``.
2876+
- If ``a`` is ``+infinity`` and ``b`` is a positive (i.e., greater than ``0``) finite number, the result is ``+infinity + 0 j``.
28772877
- If ``a`` is ``-infinity`` and ``b`` is ``NaN``, the result is ``NaN + infinity j`` (sign of the imaginary component is unspecified).
28782878
- If ``a`` is ``+infinity`` and ``b`` is ``NaN``, the result is ``+infinity + NaN j``.
28792879
- If ``a`` is ``NaN`` and ``b`` is any value, the result is ``NaN + NaN j``.

src/array_api_stubs/_2024_12/manipulation_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def concat(
7979
"""
8080

8181

82-
def expand_dims(x: array, /, *, axis: int = 0) -> array:
82+
def expand_dims(x: array, /, axis: int) -> array:
8383
"""
8484
Expands the shape of an array by inserting a new axis (dimension) of size one at the position specified by ``axis``.
8585

src/array_api_stubs/_draft/creation_functions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ def linspace(
451451
"""
452452

453453

454-
def meshgrid(*arrays: array, indexing: Literal["xy", "ij"] = "xy") -> List[array]:
454+
def meshgrid(*arrays: array, indexing: Literal["xy", "ij"] = "xy") -> Tuple[array, ...]:
455455
"""
456456
Returns coordinate matrices from coordinate vectors.
457457
@@ -464,8 +464,8 @@ def meshgrid(*arrays: array, indexing: Literal["xy", "ij"] = "xy") -> List[array
464464
465465
Returns
466466
-------
467-
out: List[array]
468-
list of N arrays, where ``N`` is the number of provided one-dimensional input arrays. Each returned array must have rank ``N``. For ``N`` one-dimensional arrays having lengths ``Ni = len(xi)``,
467+
out: Tuple[array, ...]
468+
tuple of N arrays, where ``N`` is the number of provided one-dimensional input arrays. Each returned array must have rank ``N``. For ``N`` one-dimensional arrays having lengths ``Ni = len(xi)``,
469469
470470
- if matrix indexing ``ij``, then each returned array must have the shape ``(N1, N2, N3, ..., Nn)``.
471471
- if Cartesian indexing ``xy``, then each returned array must have shape ``(N2, N1, N3, ..., Nn)``.

src/array_api_stubs/_draft/elementwise_functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2872,8 +2872,8 @@ def sqrt(x: array, /) -> array:
28722872
- If ``a`` is either ``+0`` or ``-0`` and ``b`` is ``+0``, the result is ``+0 + 0j``.
28732873
- If ``a`` is any value (including ``NaN``) and ``b`` is ``+infinity``, the result is ``+infinity + infinity j``.
28742874
- If ``a`` is a finite number and ``b`` is ``NaN``, the result is ``NaN + NaN j``.
2875-
- If ``a`` ``-infinity`` and ``b`` is a positive (i.e., greater than ``0``) finite number, the result is ``NaN + NaN j``.
2876-
- If ``a`` is ``+infinity`` and ``b`` is a positive (i.e., greater than ``0``) finite number, the result is ``+0 + infinity j``.
2875+
- If ``a`` ``-infinity`` and ``b`` is a positive (i.e., greater than ``0``) finite number, the result is ``+0 + infinity j``.
2876+
- If ``a`` is ``+infinity`` and ``b`` is a positive (i.e., greater than ``0``) finite number, the result is ``+infinity + 0 j``.
28772877
- If ``a`` is ``-infinity`` and ``b`` is ``NaN``, the result is ``NaN + infinity j`` (sign of the imaginary component is unspecified).
28782878
- If ``a`` is ``+infinity`` and ``b`` is ``NaN``, the result is ``+infinity + NaN j``.
28792879
- If ``a`` is ``NaN`` and ``b`` is any value, the result is ``NaN + NaN j``.

0 commit comments

Comments
 (0)