Skip to content

Commit fc4e01d

Browse files
kgrytemdhaber
andauthored
Apply suggestions from code review
Co-authored-by: Matt Haberland <[email protected]>
1 parent 07287b7 commit fc4e01d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/array_api_stubs/_2023_12/searching_functions.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,13 @@ def searchsorted(
107107
side: Literal['left', 'right']
108108
argument controlling which index is returned if a value lands exactly on an edge.
109109
110-
Let ``x2`` be an array of rank ``N`` where ``v`` is an individual element given by ``v = x2[n,m,...,j]``.
110+
Let ``v`` be an element of ``x2`` given by ``v = x2[j]``, where ``j`` refers to a valid scalar or tuple index.
111111
112-
- If ``v`` is less than all elements in ``x1``, then the returned index for that element must be ``0``.
113-
- If ``v`` is greater than all elements in ``x1``, then the returned index for that element must be ``M``, where ``M`` is the number of elements in ``x1``.
114-
- Otherwise, if ``side == 'left'``, then each returned index ``i`` must satisfy the index condition ``x1[i-1] < v <= x1[i]``. If ``side == 'right'``, then each returned index ``i`` must satisfy the index condition ``x1[i-1] <= v < x1[i]``.
112+
- If ``v`` is less than all elements in ``x1``, then ``out[j]`` must be ``0``.
113+
- If ``v`` is greater than all elements in ``x1``, then ``out[j]`` must be ``M``, where ``M`` is the number of elements in ``x1``.
114+
- Otherwise, each returned index ``i = out[j]`` must satisfy an index condition:
115+
- If ``side == 'left'``, then ``x1[i-1] < v <= x1[i]``.
116+
- If ``side == 'right'``, then ``x1[i-1] <= v < x1[i]``.
115117
116118
Default: ``'left'``.
117119
sorter: Optional[array]

0 commit comments

Comments
 (0)