summaryrefslogtreecommitdiff
path: root/numpy/_array_api/_searching_functions.py
diff options
context:
space:
mode:
authorAaron Meurer <asmeurer@gmail.com>2021-01-12 16:36:41 -0700
committerAaron Meurer <asmeurer@gmail.com>2021-01-12 16:36:41 -0700
commit00dda8df893d2df8730e0977178f1a116ec9cf91 (patch)
tree8fd3baffd85940472245c2fe7310868f34c7a819 /numpy/_array_api/_searching_functions.py
parenta78d20a279b3f081367109338c78ab20e08c642c (diff)
downloadnumpy-00dda8df893d2df8730e0977178f1a116ec9cf91.tar.gz
Add basic docstrings to the array API wrapper functions
The docstrings just point back to the functions they wrap for now. More thought may need to be put into this for the future. Most functions can actually perhaps inherit the docstring of the function they wrap directly, but there are some functions that have differences (e.g., different names, different keyword arguments, fewer keyword arguments, etc.). There's also the question of how to handle cross-references/see alsos that point to functions not in the API spec and behavior shown in docstring examples that isn't required in the spec.
Diffstat (limited to 'numpy/_array_api/_searching_functions.py')
-rw-r--r--numpy/_array_api/_searching_functions.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/numpy/_array_api/_searching_functions.py b/numpy/_array_api/_searching_functions.py
index 62763eaca..4eed66c48 100644
--- a/numpy/_array_api/_searching_functions.py
+++ b/numpy/_array_api/_searching_functions.py
@@ -1,13 +1,33 @@
import numpy as np
def argmax(x, /, *, axis=None, keepdims=False):
+ """
+ Array API compatible wrapper for :py:func:`np.argmax <numpy.argmax>`.
+
+ See its docstring for more information.
+ """
return np.argmax(x, axis=axis, keepdims=keepdims)
def argmin(x, /, *, axis=None, keepdims=False):
+ """
+ Array API compatible wrapper for :py:func:`np.argmin <numpy.argmin>`.
+
+ See its docstring for more information.
+ """
return np.argmin(x, axis=axis, keepdims=keepdims)
def nonzero(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.nonzero <numpy.nonzero>`.
+
+ See its docstring for more information.
+ """
return np.nonzero(x)
def where(condition, x1, x2, /):
+ """
+ Array API compatible wrapper for :py:func:`np.where <numpy.where>`.
+
+ See its docstring for more information.
+ """
return np.where(condition, x1, x2)