Skip to content

Commit f7d16ff

Browse files
lucascolleykgryte
andauthored
fix: clarify that condition should have a boolean dtype in where
PR-URL: data-apis#868 Ref: data-apis#116 Co-authored-by: Athan Reines <kgryte@gmail.com> Reviewed-by: Athan Reines <kgryte@gmail.com> Reviewed-by: Ralf Gommers <ralf.gommers@gmail.com>
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy