Skip to content

Commit ac19a23

Browse files
committed
numpy doc: notes format
1 parent b2a567e commit ac19a23

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/array_api_extra/_delegation.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -528,11 +528,6 @@ def partition(
528528
The ordering of the elements in the two partitions on the either side of
529529
the k-th element in the output array is undefined.
530530
531-
Notes:
532-
If `xp` implements ``partition`` or an equivalent function (e.g. ``topk`` for torch),
533-
complexity will likely be O(n).
534-
If not, this function simply calls ``xp.sort`` and complexity is O(n log n).
535-
536531
Parameters
537532
----------
538533
a : Array
@@ -549,6 +544,12 @@ def partition(
549544
-------
550545
partitioned_array
551546
Array of the same type and shape as `a`.
547+
548+
Notes
549+
-----
550+
If `xp` implements ``partition`` or an equivalent function
551+
(e.g. ``topk`` for torch), complexity will likely be O(n).
552+
If not, this function simply calls ``xp.sort`` and complexity is O(n log n).
552553
"""
553554
# Validate inputs.
554555
if xp is None:
@@ -620,11 +621,6 @@ def argpartition(
620621
It returns an array of indices of the same shape as `a` that
621622
index data along the given axis in partitioned order.
622623
623-
Notes:
624-
If `xp` implements `argpartition` or an equivalent method (e.g. topk for torch),
625-
complexity will likely be O(n).
626-
If not, this function simply calls `xp.argsort` and complexity is O(n log n).
627-
628624
Parameters
629625
----------
630626
a : Array
@@ -641,6 +637,12 @@ def argpartition(
641637
-------
642638
index_array
643639
Array of indices that partition `a` along the specified axis.
640+
641+
Notes
642+
-----
643+
If `xp` implements ``argpartition`` or an equivalent function
644+
e.g. ``topk`` for torch), complexity will likely be O(n).
645+
If not, this function simply calls ``xp.argsort`` and complexity is O(n log n).
644646
"""
645647
# Validate inputs.
646648
if xp is None:

0 commit comments

Comments
 (0)