You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/array_api_stubs/_draft/set_functions.py
+8-17Lines changed: 8 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -5,21 +5,21 @@
5
5
6
6
7
7
defisin(
8
-
x1: Union[array, int, float, complex, bool],
9
-
x2: Union[array, int, float, complex, bool],
8
+
x1: Union[array, int],
9
+
x2: Union[array, int],
10
10
/,
11
11
*,
12
12
invert: bool=False,
13
13
) ->array:
14
14
"""
15
-
Tests whether each element in ``x1`` is in ``x2``.
15
+
Tests for each element in ``x1`` whether the element is in ``x2``.
16
16
17
17
Parameters
18
18
----------
19
-
x1: Union[array, int, float, complex, bool]
20
-
first input array. **May** have any data type.
21
-
x2: Union[array, int, float, complex, bool]
22
-
second input array. **May** have any data type.
19
+
x1: Union[array, int]
20
+
first input array. **Should** have an integer data type.
21
+
x2: Union[array, int]
22
+
second input array. **Should** have an integer data type.
23
23
invert: bool
24
24
boolean indicating whether to invert the test criterion. If ``True``, the function **must** test whether each element in ``x1`` is *not* in ``x2``. If ``False``, the function **must** test whether each element in ``x1`` is in ``x2``. Default: ``False``.
25
25
@@ -32,17 +32,8 @@ def isin(
32
32
-----
33
33
34
34
- At least one of ``x1`` or ``x2`` **must** be an array.
35
-
36
35
- If an element in ``x1`` is in ``x2``, the corresponding element in the output array **must** be ``True``; otherwise, the corresponding element in the output array **must** be ``False``.
37
-
38
-
- Testing whether an element in ``x1`` corresponds to an element in ``x2`` **must** be determined based on value equality (see :func:`~array_api.equal`). For input arrays having floating-point data types, value-based equality implies the following behavior. When ``invert`` is ``False``,
39
-
40
-
- As ``nan`` values compare as ``False``, if an element in ``x1`` is ``nan``, the corresponding element in the returned array **must** be ``False``.
41
-
- As complex floating-point values having at least one ``nan`` component compare as ``False``, if an element in ``x1`` is a complex floating-point value having one or more ``nan`` components, the corresponding element in the returned array **must** be ``False``.
42
-
- As ``-0`` and ``+0`` compare as ``True``, if an element in ``x1`` is ``±0`` and ``x2`` contains at least one element which is ``±0``, the corresponding element in the returned array **must** be ``True``.
43
-
44
-
When ``invert`` is ``True``, the returned array **must** contain the same results as if the operation is implemented as ``logical_not(isin(x1, x2))``.
45
-
36
+
- Testing whether an element in ``x1`` corresponds to an element in ``x2`` **must** be determined based on value equality (see :func:`~array_api.equal`).
46
37
- Comparison of arrays without a corresponding promotable data type (see :ref:`type-promotion`) is unspecified and thus implementation-defined.
0 commit comments