Skip to content

Commit

Permalink
fix: clarify that condition should have a boolean dtype in where
Browse files Browse the repository at this point in the history
PR-URL: #868
Ref: #116
Co-authored-by: Athan Reines <[email protected]>
Reviewed-by: Athan Reines <[email protected]> 
Reviewed-by: Ralf Gommers <[email protected]>
  • Loading branch information
lucascolley and kgryte authored Dec 12, 2024
1 parent c492972 commit f7d16ff
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/array_api_stubs/_2021_12/searching_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def where(condition: array, x1: array, x2: array, /) -> array:
Parameters
----------
condition: array
when ``True``, yield ``x1_i``; otherwise, yield ``x2_i``. Must be compatible with ``x1`` and ``x2`` (see :ref:`broadcasting`).
when ``True``, yield ``x1_i``; otherwise, yield ``x2_i``. Should have a boolean data type. Must be compatible with ``x1`` and ``x2`` (see :ref:`broadcasting`).
x1: array
first input array. Must be compatible with ``condition`` and ``x2`` (see :ref:`broadcasting`).
x2: array
Expand Down
2 changes: 1 addition & 1 deletion src/array_api_stubs/_2022_12/searching_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def where(condition: array, x1: array, x2: array, /) -> array:
Parameters
----------
condition: array
when ``True``, yield ``x1_i``; otherwise, yield ``x2_i``. Must be compatible with ``x1`` and ``x2`` (see :ref:`broadcasting`).
when ``True``, yield ``x1_i``; otherwise, yield ``x2_i``. Should have a boolean data type. Must be compatible with ``x1`` and ``x2`` (see :ref:`broadcasting`).
x1: array
first input array. Must be compatible with ``condition`` and ``x2`` (see :ref:`broadcasting`).
x2: array
Expand Down
2 changes: 1 addition & 1 deletion src/array_api_stubs/_2023_12/searching_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def where(condition: array, x1: array, x2: array, /) -> array:
Parameters
----------
condition: array
when ``True``, yield ``x1_i``; otherwise, yield ``x2_i``. Must be compatible with ``x1`` and ``x2`` (see :ref:`broadcasting`).
when ``True``, yield ``x1_i``; otherwise, yield ``x2_i``. Should have a boolean data type. Must be compatible with ``x1`` and ``x2`` (see :ref:`broadcasting`).
x1: array
first input array. Must be compatible with ``condition`` and ``x2`` (see :ref:`broadcasting`).
x2: array
Expand Down
2 changes: 1 addition & 1 deletion src/array_api_stubs/_draft/searching_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def where(condition: array, x1: array, x2: array, /) -> array:
Parameters
----------
condition: array
when ``True``, yield ``x1_i``; otherwise, yield ``x2_i``. Must be compatible with ``x1`` and ``x2`` (see :ref:`broadcasting`).
when ``True``, yield ``x1_i``; otherwise, yield ``x2_i``. Should have a boolean data type. Must be compatible with ``x1`` and ``x2`` (see :ref:`broadcasting`).
x1: array
first input array. Must be compatible with ``condition`` and ``x2`` (see :ref:`broadcasting`).
x2: array
Expand Down

0 comments on commit f7d16ff

Please sign in to comment.