summaryrefslogtreecommitdiff
path: root/numpy/_array_api/_elementwise_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/_elementwise_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/_elementwise_functions.py')
-rw-r--r--numpy/_array_api/_elementwise_functions.py275
1 files changed, 275 insertions, 0 deletions
diff --git a/numpy/_array_api/_elementwise_functions.py b/numpy/_array_api/_elementwise_functions.py
index ef820dd5b..7ec01b2e1 100644
--- a/numpy/_array_api/_elementwise_functions.py
+++ b/numpy/_array_api/_elementwise_functions.py
@@ -1,177 +1,452 @@
import numpy as np
def abs(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.abs <numpy.abs>`.
+
+ See its docstring for more information.
+ """
return np.abs(x)
def acos(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.arccos <numpy.arccos>`.
+
+ See its docstring for more information.
+ """
# Note: the function name is different here
return np.arccos(x)
def acosh(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.arccosh <numpy.arccosh>`.
+
+ See its docstring for more information.
+ """
# Note: the function name is different here
return np.arccosh(x)
def add(x1, x2, /):
+ """
+ Array API compatible wrapper for :py:func:`np.add <numpy.add>`.
+
+ See its docstring for more information.
+ """
return np.add(x1, x2)
def asin(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.arcsin <numpy.arcsin>`.
+
+ See its docstring for more information.
+ """
# Note: the function name is different here
return np.arcsin(x)
def asinh(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.arcsinh <numpy.arcsinh>`.
+
+ See its docstring for more information.
+ """
# Note: the function name is different here
return np.arcsinh(x)
def atan(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.arctan <numpy.arctan>`.
+
+ See its docstring for more information.
+ """
# Note: the function name is different here
return np.arctan(x)
def atan2(x1, x2, /):
+ """
+ Array API compatible wrapper for :py:func:`np.arctan2 <numpy.arctan2>`.
+
+ See its docstring for more information.
+ """
# Note: the function name is different here
return np.arctan2(x1, x2)
def atanh(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.arctanh <numpy.arctanh>`.
+
+ See its docstring for more information.
+ """
# Note: the function name is different here
return np.arctanh(x)
def bitwise_and(x1, x2, /):
+ """
+ Array API compatible wrapper for :py:func:`np.bitwise_and <numpy.bitwise_and>`.
+
+ See its docstring for more information.
+ """
return np.bitwise_and(x1, x2)
def bitwise_left_shift(x1, x2, /):
+ """
+ Array API compatible wrapper for :py:func:`np.left_shift <numpy.left_shift>`.
+
+ See its docstring for more information.
+ """
# Note: the function name is different here
return np.left_shift(x1, x2)
def bitwise_invert(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.invert <numpy.invert>`.
+
+ See its docstring for more information.
+ """
# Note: the function name is different here
return np.invert(x)
def bitwise_or(x1, x2, /):
+ """
+ Array API compatible wrapper for :py:func:`np.bitwise_or <numpy.bitwise_or>`.
+
+ See its docstring for more information.
+ """
return np.bitwise_or(x1, x2)
def bitwise_right_shift(x1, x2, /):
+ """
+ Array API compatible wrapper for :py:func:`np.right_shift <numpy.right_shift>`.
+
+ See its docstring for more information.
+ """
# Note: the function name is different here
return np.right_shift(x1, x2)
def bitwise_xor(x1, x2, /):
+ """
+ Array API compatible wrapper for :py:func:`np.bitwise_xor <numpy.bitwise_xor>`.
+
+ See its docstring for more information.
+ """
return np.bitwise_xor(x1, x2)
def ceil(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.ceil <numpy.ceil>`.
+
+ See its docstring for more information.
+ """
return np.ceil(x)
def cos(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.cos <numpy.cos>`.
+
+ See its docstring for more information.
+ """
return np.cos(x)
def cosh(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.cosh <numpy.cosh>`.
+
+ See its docstring for more information.
+ """
return np.cosh(x)
def divide(x1, x2, /):
+ """
+ Array API compatible wrapper for :py:func:`np.divide <numpy.divide>`.
+
+ See its docstring for more information.
+ """
return np.divide(x1, x2)
def equal(x1, x2, /):
+ """
+ Array API compatible wrapper for :py:func:`np.equal <numpy.equal>`.
+
+ See its docstring for more information.
+ """
return np.equal(x1, x2)
def exp(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.exp <numpy.exp>`.
+
+ See its docstring for more information.
+ """
return np.exp(x)
def expm1(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.expm1 <numpy.expm1>`.
+
+ See its docstring for more information.
+ """
return np.expm1(x)
def floor(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.floor <numpy.floor>`.
+
+ See its docstring for more information.
+ """
return np.floor(x)
def floor_divide(x1, x2, /):
+ """
+ Array API compatible wrapper for :py:func:`np.floor_divide <numpy.floor_divide>`.
+
+ See its docstring for more information.
+ """
return np.floor_divide(x1, x2)
def greater(x1, x2, /):
+ """
+ Array API compatible wrapper for :py:func:`np.greater <numpy.greater>`.
+
+ See its docstring for more information.
+ """
return np.greater(x1, x2)
def greater_equal(x1, x2, /):
+ """
+ Array API compatible wrapper for :py:func:`np.greater_equal <numpy.greater_equal>`.
+
+ See its docstring for more information.
+ """
return np.greater_equal(x1, x2)
def isfinite(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.isfinite <numpy.isfinite>`.
+
+ See its docstring for more information.
+ """
return np.isfinite(x)
def isinf(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.isinf <numpy.isinf>`.
+
+ See its docstring for more information.
+ """
return np.isinf(x)
def isnan(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.isnan <numpy.isnan>`.
+
+ See its docstring for more information.
+ """
return np.isnan(x)
def less(x1, x2, /):
+ """
+ Array API compatible wrapper for :py:func:`np.less <numpy.less>`.
+
+ See its docstring for more information.
+ """
return np.less(x1, x2)
def less_equal(x1, x2, /):
+ """
+ Array API compatible wrapper for :py:func:`np.less_equal <numpy.less_equal>`.
+
+ See its docstring for more information.
+ """
return np.less_equal(x1, x2)
def log(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.log <numpy.log>`.
+
+ See its docstring for more information.
+ """
return np.log(x)
def log1p(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.log1p <numpy.log1p>`.
+
+ See its docstring for more information.
+ """
return np.log1p(x)
def log2(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.log2 <numpy.log2>`.
+
+ See its docstring for more information.
+ """
return np.log2(x)
def log10(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.log10 <numpy.log10>`.
+
+ See its docstring for more information.
+ """
return np.log10(x)
def logical_and(x1, x2, /):
+ """
+ Array API compatible wrapper for :py:func:`np.logical_and <numpy.logical_and>`.
+
+ See its docstring for more information.
+ """
return np.logical_and(x1, x2)
def logical_not(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.logical_not <numpy.logical_not>`.
+
+ See its docstring for more information.
+ """
return np.logical_not(x)
def logical_or(x1, x2, /):
+ """
+ Array API compatible wrapper for :py:func:`np.logical_or <numpy.logical_or>`.
+
+ See its docstring for more information.
+ """
return np.logical_or(x1, x2)
def logical_xor(x1, x2, /):
+ """
+ Array API compatible wrapper for :py:func:`np.logical_xor <numpy.logical_xor>`.
+
+ See its docstring for more information.
+ """
return np.logical_xor(x1, x2)
def multiply(x1, x2, /):
+ """
+ Array API compatible wrapper for :py:func:`np.multiply <numpy.multiply>`.
+
+ See its docstring for more information.
+ """
return np.multiply(x1, x2)
def negative(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.negative <numpy.negative>`.
+
+ See its docstring for more information.
+ """
return np.negative(x)
def not_equal(x1, x2, /):
+ """
+ Array API compatible wrapper for :py:func:`np.not_equal <numpy.not_equal>`.
+
+ See its docstring for more information.
+ """
return np.not_equal(x1, x2)
def positive(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.positive <numpy.positive>`.
+
+ See its docstring for more information.
+ """
return np.positive(x)
def pow(x1, x2, /):
+ """
+ Array API compatible wrapper for :py:func:`np.power <numpy.power>`.
+
+ See its docstring for more information.
+ """
# Note: the function name is different here
return np.power(x1, x2)
def remainder(x1, x2, /):
+ """
+ Array API compatible wrapper for :py:func:`np.remainder <numpy.remainder>`.
+
+ See its docstring for more information.
+ """
return np.remainder(x1, x2)
def round(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.round <numpy.round>`.
+
+ See its docstring for more information.
+ """
return np.round(x)
def sign(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.sign <numpy.sign>`.
+
+ See its docstring for more information.
+ """
return np.sign(x)
def sin(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.sin <numpy.sin>`.
+
+ See its docstring for more information.
+ """
return np.sin(x)
def sinh(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.sinh <numpy.sinh>`.
+
+ See its docstring for more information.
+ """
return np.sinh(x)
def square(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.square <numpy.square>`.
+
+ See its docstring for more information.
+ """
return np.square(x)
def sqrt(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.sqrt <numpy.sqrt>`.
+
+ See its docstring for more information.
+ """
return np.sqrt(x)
def subtract(x1, x2, /):
+ """
+ Array API compatible wrapper for :py:func:`np.subtract <numpy.subtract>`.
+
+ See its docstring for more information.
+ """
return np.subtract(x1, x2)
def tan(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.tan <numpy.tan>`.
+
+ See its docstring for more information.
+ """
return np.tan(x)
def tanh(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.tanh <numpy.tanh>`.
+
+ See its docstring for more information.
+ """
return np.tanh(x)
def trunc(x, /):
+ """
+ Array API compatible wrapper for :py:func:`np.trunc <numpy.trunc>`.
+
+ See its docstring for more information.
+ """
return np.trunc(x)