summaryrefslogtreecommitdiff
path: root/doc/source/reference
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2019-02-14 00:21:09 +0200
committerGitHub <noreply@github.com>2019-02-14 00:21:09 +0200
commitdea85807c258ded3f75528cce2a444468de93bc1 (patch)
tree9ccdc7ed5cedd15653e4cf44257e60ae5ba2b815 /doc/source/reference
parent1c4ab89870e39be7c4a47258f6d92f532650e5cc (diff)
parent107e45b82021ba04f651f0ef89aa2f419d404d64 (diff)
downloadnumpy-dea85807c258ded3f75528cce2a444468de93bc1.tar.gz
Merge pull request #12945 from charris/fix-timsort-compat
BUG: Add timsort without breaking the API.
Diffstat (limited to 'doc/source/reference')
-rw-r--r--doc/source/reference/c-api.array.rst37
1 files changed, 22 insertions, 15 deletions
diff --git a/doc/source/reference/c-api.array.rst b/doc/source/reference/c-api.array.rst
index cf3c10e3b..44d09a9fe 100644
--- a/doc/source/reference/c-api.array.rst
+++ b/doc/source/reference/c-api.array.rst
@@ -1906,20 +1906,21 @@ Item selection and manipulation
.. c:function:: PyObject* PyArray_Sort(PyArrayObject* self, int axis, NPY_SORTKIND kind)
- Equivalent to :meth:`ndarray.sort<numpy.ndarray.sort>` (*self*, *axis*, *kind*). Return an array with
- the items of *self* sorted along *axis*.Array is sorted according to *kind* which is an integer/enum pointing to the type of sorting algorithms used.
+ Equivalent to :meth:`ndarray.sort<numpy.ndarray.sort>` (*self*, *axis*, *kind*).
+ Return an array with the items of *self* sorted along *axis*. The array
+ is sorted using the algorithm denoted by *kind* , which is an integer/enum pointing
+ to the type of sorting algorithms used.
.. c:function:: PyObject* PyArray_ArgSort(PyArrayObject* self, int axis)
- Equivalent to :meth:`ndarray.argsort<numpy.ndarray.argsort>` (*self*, *axis*). Return an array of
- indices such that selection of these indices along the given
- ``axis`` would return a sorted version of *self*. If *self*
- ->descr is a data-type with fields defined, then
- self->descr->names is used to determine the sort order. A
- comparison where the first field is equal will use the second
- field and so on. To alter the sort order of a structured array, create
- a new data-type with a different order of names and construct a
- view of the array with that new data-type.
+ Equivalent to :meth:`ndarray.argsort<numpy.ndarray.argsort>` (*self*, *axis*).
+ Return an array of indices such that selection of these indices
+ along the given ``axis`` would return a sorted version of *self*. If *self* ->descr
+ is a data-type with fields defined, then self->descr->names is used
+ to determine the sort order. A comparison where the first field is equal
+ will use the second field and so on. To alter the sort order of a
+ structured array, create a new data-type with a different order of names
+ and construct a view of the array with that new data-type.
.. c:function:: PyObject* PyArray_LexSort(PyObject* sort_keys, int axis)
@@ -2989,8 +2990,10 @@ to.
Convert Python strings into one of :c:data:`NPY_QUICKSORT` (starts
with 'q' or 'Q'), :c:data:`NPY_HEAPSORT` (starts with 'h' or 'H'),
- :c:data:`NPY_MERGESORT` (starts with 'm' or 'M') or :c:data:`NPY_TIMSORT`
- (starts with 't' or 'T').
+ :c:data:`NPY_MERGESORT` (starts with 'm' or 'M') or :c:data:`NPY_STABLESORT`
+ (starts with 't' or 'T'). :c:data:`NPY_MERGESORT` and :c:data:`NPY_STABLESORT`
+ are aliased to each other for backwards compatibility and may refer to one
+ of several stable sorting algorithms depending on the data type.
.. c:function:: int PyArray_SearchsideConverter( \
PyObject* obj, NPY_SEARCHSIDE* side)
@@ -3534,11 +3537,15 @@ Enumerated Types
A special variable-type which can take on the values :c:data:`NPY_{KIND}`
where ``{KIND}`` is
- **QUICKSORT**, **HEAPSORT**, **MERGESORT**, **TIMSORT**
+ **QUICKSORT**, **HEAPSORT**, **MERGESORT**, **STABLESORT**
.. c:var:: NPY_NSORTS
- Defined to be the number of sorts.
+ Defined to be the number of sorts. It is fixed at three by the need for
+ backwards compatibility, and consequently :c:data:`NPY_MERGESORT` and
+ :c:data:`NPY_STABLESORT` are aliased to each other and may refer to one
+ of several stable sorting algorithms depending on the data type.
+
.. c:type:: NPY_SCALARKIND