Skip to content

Commit 18bac7e

Browse files
committed
docs: update copy
1 parent fc4e01d commit 18bac7e

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/array_api_stubs/_2023_12/searching_functions.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +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 ``v`` be an element of ``x2`` given by ``v = x2[j]``, where ``j`` refers to a valid scalar or tuple index.
110+
Let ``v`` be an element of ``x2`` given by ``v = x2[j]``, where ``j`` refers to a valid index (see :ref:`indexing`).
111111
112112
- If ``v`` is less than all elements in ``x1``, then ``out[j]`` must be ``0``.
113113
- If ``v`` is greater than all elements in ``x1``, then ``out[j]`` must be ``M``, where ``M`` is the number of elements in ``x1``.
114114
- Otherwise, each returned index ``i = out[j]`` must satisfy an index condition:
115-
- If ``side == 'left'``, then ``x1[i-1] < v <= x1[i]``.
115+
116+
- If ``side == 'left'``, then ``x1[i-1] < v <= x1[i]``.
116117
- If ``side == 'right'``, then ``x1[i-1] <= v < x1[i]``.
117118
118119
Default: ``'left'``.

src/array_api_stubs/_draft/searching_functions.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,14 @@ def searchsorted(
136136
side: Literal['left', 'right']
137137
argument controlling which index is returned if a value lands exactly on an edge.
138138
139-
Let ``x2`` be an array of rank ``N`` where ``v`` is an individual element given by ``v = x2[n,m,...,j]``.
139+
Let ``v`` be an element of ``x2`` given by ``v = x2[j]``, where ``j`` refers to a valid index (see :ref:`indexing`).
140140
141-
- If ``v`` is less than all elements in ``x1``, then the returned index for that element must be ``0``.
142-
- 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``.
143-
- 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]``.
141+
- If ``v`` is less than all elements in ``x1``, then ``out[j]`` must be ``0``.
142+
- If ``v`` is greater than all elements in ``x1``, then ``out[j]`` must be ``M``, where ``M`` is the number of elements in ``x1``.
143+
- Otherwise, each returned index ``i = out[j]`` must satisfy an index condition:
144+
145+
- If ``side == 'left'``, then ``x1[i-1] < v <= x1[i]``.
146+
- If ``side == 'right'``, then ``x1[i-1] <= v < x1[i]``.
144147
145148
Default: ``'left'``.
146149
sorter: Optional[array]

0 commit comments

Comments
 (0)