summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarren Weckesser <warren.weckesser@gmail.com>2019-12-08 00:18:45 -0500
committerWarren Weckesser <warren.weckesser@gmail.com>2019-12-08 00:18:45 -0500
commit98c14a085cece71f54910cd11c39fe7a193d6022 (patch)
tree435485d6682907f2f142b7ec6c3c31ca4cdf5204
parent6be17044b69258f0c35e777f10538e3dbcb3dc26 (diff)
downloadnumpy-98c14a085cece71f54910cd11c39fe7a193d6022.tar.gz
MAINT: core: Fix a very long line in generated ufunc docstrings.
Put the $BROADCASTABLE_2 text on its own line, and add a line break in the text. This changes a typical ufunc docstring from this (note the very long line beginning 'The arrays to be subtracted...'): ``` Parameters ---------- x1, x2 : array_like The arrays to be subtracted from each other. If ``x1.shape != x2.shape``, they must be broadcastable to a common shape (which becomes the shape of the output). out : ndarray, None, or tuple of ndarray and None, optional A location into which the result is stored. If provided, it must have ``` to this: ``` Parameters ---------- x1, x2 : array_like The arrays to be subtracted from each other. If ``x1.shape != x2.shape``, they must be broadcastable to a common shape (which becomes the shape of the output). out : ndarray, None, or tuple of ndarray and None, optional A location into which the result is stored. If provided, it must have ```
-rw-r--r--numpy/core/code_generators/ufunc_docstrings.py112
1 files changed, 74 insertions, 38 deletions
diff --git a/numpy/core/code_generators/ufunc_docstrings.py b/numpy/core/code_generators/ufunc_docstrings.py
index 4dec73505..dfa20f221 100644
--- a/numpy/core/code_generators/ufunc_docstrings.py
+++ b/numpy/core/code_generators/ufunc_docstrings.py
@@ -37,8 +37,8 @@ subst = {
:ref:`ufunc docs <ufuncs.kwargs>`.
""").strip(),
'BROADCASTABLE_2': ("If ``x1.shape != x2.shape``, they must be "
- "broadcastable to a common shape (which becomes the "
- "shape of the output)."),
+ "broadcastable to a common\n shape (which becomes "
+ "the shape of the output)."),
'OUT_SCALAR_1': "This is a scalar if `x` is a scalar.",
'OUT_SCALAR_2': "This is a scalar if both `x1` and `x2` are scalars.",
}
@@ -117,7 +117,8 @@ add_newdoc('numpy.core.umath', 'add',
Parameters
----------
x1, x2 : array_like
- The arrays to be added. $BROADCASTABLE_2
+ The arrays to be added.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -443,7 +444,8 @@ add_newdoc('numpy.core.umath', 'arctan2',
x1 : array_like, real-valued
`y`-coordinates.
x2 : array_like, real-valued
- `x`-coordinates. $BROADCASTABLE_2
+ `x`-coordinates.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -566,7 +568,8 @@ add_newdoc('numpy.core.umath', 'bitwise_and',
Parameters
----------
x1, x2 : array_like
- Only integer and boolean types are handled. $BROADCASTABLE_2
+ Only integer and boolean types are handled.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -619,7 +622,8 @@ add_newdoc('numpy.core.umath', 'bitwise_or',
Parameters
----------
x1, x2 : array_like
- Only integer and boolean types are handled. $BROADCASTABLE_2
+ Only integer and boolean types are handled.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -677,7 +681,8 @@ add_newdoc('numpy.core.umath', 'bitwise_xor',
Parameters
----------
x1, x2 : array_like
- Only integer and boolean types are handled. $BROADCASTABLE_2
+ Only integer and boolean types are handled.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -987,7 +992,8 @@ add_newdoc('numpy.core.umath', 'heaviside',
x1 : array_like
Input values.
x2 : array_like
- The value of the function when x1 is 0. $BROADCASTABLE_2
+ The value of the function when x1 is 0.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -1022,7 +1028,8 @@ add_newdoc('numpy.core.umath', 'divide',
x1 : array_like
Dividend array.
x2 : array_like
- Divisor array. $BROADCASTABLE_2
+ Divisor array.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -1091,7 +1098,8 @@ add_newdoc('numpy.core.umath', 'equal',
Parameters
----------
x1, x2 : array_like
- Input arrays. $BROADCASTABLE_2
+ Input arrays.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -1338,7 +1346,8 @@ add_newdoc('numpy.core.umath', 'floor_divide',
x1 : array_like
Numerator.
x2 : array_like
- Denominator. $BROADCASTABLE_2
+ Denominator.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -1378,7 +1387,8 @@ add_newdoc('numpy.core.umath', 'fmod',
x1 : array_like
Dividend.
x2 : array_like
- Divisor. $BROADCASTABLE_2
+ Divisor.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -1428,7 +1438,8 @@ add_newdoc('numpy.core.umath', 'greater',
Parameters
----------
x1, x2 : array_like
- Input arrays. $BROADCASTABLE_2
+ Input arrays.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -1464,7 +1475,8 @@ add_newdoc('numpy.core.umath', 'greater_equal',
Parameters
----------
x1, x2 : array_like
- Input arrays. $BROADCASTABLE_2
+ Input arrays.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -1497,7 +1509,8 @@ add_newdoc('numpy.core.umath', 'hypot',
Parameters
----------
x1, x2 : array_like
- Leg of the triangle(s). $BROADCASTABLE_2
+ Leg of the triangle(s).
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -1832,7 +1845,8 @@ add_newdoc('numpy.core.umath', 'less',
Parameters
----------
x1, x2 : array_like
- Input arrays. $BROADCASTABLE_2
+ Input arrays.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -1860,7 +1874,8 @@ add_newdoc('numpy.core.umath', 'less_equal',
Parameters
----------
x1, x2 : array_like
- Input arrays. $BROADCASTABLE_2
+ Input arrays.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -2044,7 +2059,8 @@ add_newdoc('numpy.core.umath', 'logaddexp',
Parameters
----------
x1, x2 : array_like
- Input values. $BROADCASTABLE_2
+ Input values.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -2086,7 +2102,8 @@ add_newdoc('numpy.core.umath', 'logaddexp2',
Parameters
----------
x1, x2 : array_like
- Input values. $BROADCASTABLE_2
+ Input values.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -2177,7 +2194,8 @@ add_newdoc('numpy.core.umath', 'logical_and',
Parameters
----------
x1, x2 : array_like
- Input arrays. $BROADCASTABLE_2
+ Input arrays.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -2282,7 +2300,8 @@ add_newdoc('numpy.core.umath', 'logical_xor',
Parameters
----------
x1, x2 : array_like
- Logical XOR is applied to the elements of `x1` and `x2`. $BROADCASTABLE_2
+ Logical XOR is applied to the elements of `x1` and `x2`.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -2329,7 +2348,8 @@ add_newdoc('numpy.core.umath', 'maximum',
Parameters
----------
x1, x2 : array_like
- The arrays holding the elements to be compared. $BROADCASTABLE_2
+ The arrays holding the elements to be compared.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -2387,7 +2407,8 @@ add_newdoc('numpy.core.umath', 'minimum',
Parameters
----------
x1, x2 : array_like
- The arrays holding the elements to be compared. $BROADCASTABLE_2
+ The arrays holding the elements to be compared.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -2445,7 +2466,8 @@ add_newdoc('numpy.core.umath', 'fmax',
Parameters
----------
x1, x2 : array_like
- The arrays holding the elements to be compared. $BROADCASTABLE_2
+ The arrays holding the elements to be compared.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -2502,7 +2524,8 @@ add_newdoc('numpy.core.umath', 'fmin',
Parameters
----------
x1, x2 : array_like
- The arrays holding the elements to be compared. $BROADCASTABLE_2
+ The arrays holding the elements to be compared.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -2755,7 +2778,8 @@ add_newdoc('numpy.core.umath', 'multiply',
Parameters
----------
x1, x2 : array_like
- Input arrays to be multiplied. $BROADCASTABLE_2
+ Input arrays to be multiplied.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -2836,7 +2860,8 @@ add_newdoc('numpy.core.umath', 'not_equal',
Parameters
----------
x1, x2 : array_like
- Input arrays. $BROADCASTABLE_2
+ Input arrays.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -2885,7 +2910,8 @@ add_newdoc('numpy.core.umath', 'power',
x1 : array_like
The bases.
x2 : array_like
- The exponents. $BROADCASTABLE_2
+ The exponents.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -2944,7 +2970,8 @@ add_newdoc('numpy.core.umath', 'float_power',
x1 : array_like
The bases.
x2 : array_like
- The exponents. $BROADCASTABLE_2
+ The exponents.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -3116,7 +3143,8 @@ add_newdoc('numpy.core.umath', 'remainder',
x1 : array_like
Dividend array.
x2 : array_like
- Divisor array. $BROADCASTABLE_2
+ Divisor array.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -3162,7 +3190,8 @@ add_newdoc('numpy.core.umath', 'divmod',
x1 : array_like
Dividend array.
x2 : array_like
- Divisor array. $BROADCASTABLE_2
+ Divisor array.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -3201,7 +3230,8 @@ add_newdoc('numpy.core.umath', 'right_shift',
x1 : array_like, int
Input values.
x2 : array_like, int
- Number of bits to remove at the right of `x1`. $BROADCASTABLE_2
+ Number of bits to remove at the right of `x1`.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -3335,7 +3365,8 @@ add_newdoc('numpy.core.umath', 'copysign',
x1 : array_like
Values to change the sign of.
x2 : array_like
- The sign of `x2` is copied to `x1`. $BROADCASTABLE_2
+ The sign of `x2` is copied to `x1`.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -3642,7 +3673,8 @@ add_newdoc('numpy.core.umath', 'subtract',
Parameters
----------
x1, x2 : array_like
- The arrays to be subtracted from each other. $BROADCASTABLE_2
+ The arrays to be subtracted from each other.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -3783,7 +3815,8 @@ add_newdoc('numpy.core.umath', 'true_divide',
x1 : array_like
Dividend array.
x2 : array_like
- Divisor array. $BROADCASTABLE_2
+ Divisor array.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -3880,7 +3913,8 @@ add_newdoc('numpy.core.umath', 'ldexp',
x1 : array_like
Array of multipliers.
x2 : array_like, int
- Array of twos exponents. $BROADCASTABLE_2
+ Array of twos exponents.
+ $BROADCASTABLE_2
$PARAMS
Returns
@@ -3918,7 +3952,8 @@ add_newdoc('numpy.core.umath', 'gcd',
Parameters
----------
x1, x2 : array_like, int
- Arrays of values. $BROADCASTABLE_2
+ Arrays of values.
+ $BROADCASTABLE_2
Returns
-------
@@ -3948,7 +3983,8 @@ add_newdoc('numpy.core.umath', 'lcm',
Parameters
----------
x1, x2 : array_like, int
- Arrays of values. $BROADCASTABLE_2
+ Arrays of values.
+ $BROADCASTABLE_2
Returns
-------