Skip to content

Commit f7d16ff

Browse files
lucascolleykgryte
andauthored
fix: clarify that condition should have a boolean dtype in where
PR-URL: #868 Ref: #116 Co-authored-by: Athan Reines <[email protected]> Reviewed-by: Athan Reines <[email protected]> Reviewed-by: Ralf Gommers <[email protected]>
1 parent c492972 commit f7d16ff

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/array_api_stubs/_2021_12/searching_functions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def where(condition: array, x1: array, x2: array, /) -> array:
6969
Parameters
7070
----------
7171
condition: array
72-
when ``True``, yield ``x1_i``; otherwise, yield ``x2_i``. Must be compatible with ``x1`` and ``x2`` (see :ref:`broadcasting`).
72+
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`).
7373
x1: array
7474
first input array. Must be compatible with ``condition`` and ``x2`` (see :ref:`broadcasting`).
7575
x2: array

src/array_api_stubs/_2022_12/searching_functions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def where(condition: array, x1: array, x2: array, /) -> array:
9191
Parameters
9292
----------
9393
condition: array
94-
when ``True``, yield ``x1_i``; otherwise, yield ``x2_i``. Must be compatible with ``x1`` and ``x2`` (see :ref:`broadcasting`).
94+
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`).
9595
x1: array
9696
first input array. Must be compatible with ``condition`` and ``x2`` (see :ref:`broadcasting`).
9797
x2: array

src/array_api_stubs/_2023_12/searching_functions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def where(condition: array, x1: array, x2: array, /) -> array:
146146
Parameters
147147
----------
148148
condition: array
149-
when ``True``, yield ``x1_i``; otherwise, yield ``x2_i``. Must be compatible with ``x1`` and ``x2`` (see :ref:`broadcasting`).
149+
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`).
150150
x1: array
151151
first input array. Must be compatible with ``condition`` and ``x2`` (see :ref:`broadcasting`).
152152
x2: array

src/array_api_stubs/_draft/searching_functions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def where(condition: array, x1: array, x2: array, /) -> array:
175175
Parameters
176176
----------
177177
condition: array
178-
when ``True``, yield ``x1_i``; otherwise, yield ``x2_i``. Must be compatible with ``x1`` and ``x2`` (see :ref:`broadcasting`).
178+
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`).
179179
x1: array
180180
first input array. Must be compatible with ``condition`` and ``x2`` (see :ref:`broadcasting`).
181181
x2: array

0 commit comments

Comments
 (0)