diff options
author | Bas van Beek <43369155+BvB93@users.noreply.github.com> | 2020-08-24 13:27:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-24 14:27:30 +0300 |
commit | 69898992b339e4614780f626ed07c4244a08648b (patch) | |
tree | 2ef22cd910d24953a11b038a8f1c0d546eab5979 /numpy/tests/typing/fail/fromnumeric.py | |
parent | a3fe8fa8bbc808f2a105c1140d5ea3d23b516ae1 (diff) | |
download | numpy-69898992b339e4614780f626ed07c4244a08648b.tar.gz |
ENH: Add annotations to the last 8 functions in numpy.core.fromnumeric (#16729)
* Added annotations for 8 new functions
The 8 respective functions, all located in `np.core.fromnumeric`, consist of:
* `prod`
* `cumprod`
* `ndim`
* `size`
* `around`
* `mean`
* `std`
* `var`
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Diffstat (limited to 'numpy/tests/typing/fail/fromnumeric.py')
-rw-r--r-- | numpy/tests/typing/fail/fromnumeric.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/numpy/tests/typing/fail/fromnumeric.py b/numpy/tests/typing/fail/fromnumeric.py index 66f8a89d0..c9156895d 100644 --- a/numpy/tests/typing/fail/fromnumeric.py +++ b/numpy/tests/typing/fail/fromnumeric.py @@ -124,3 +124,31 @@ np.amin(a, keepdims=1.0) # E: No overload variant of "amin" matches argument ty np.amin(a, out=1.0) # E: No overload variant of "amin" matches argument type np.amin(a, initial=[1.0]) # E: No overload variant of "amin" matches argument type np.amin(a, where=[1.0]) # E: List item 0 has incompatible type + +np.prod(a, axis=1.0) # E: No overload variant of "prod" matches argument type +np.prod(a, out=False) # E: No overload variant of "prod" matches argument type +np.prod(a, keepdims=1.0) # E: No overload variant of "prod" matches argument type +np.prod(a, initial=int) # E: No overload variant of "prod" matches argument type +np.prod(a, where=1.0) # E: No overload variant of "prod" matches argument type + +np.cumprod(a, axis=1.0) # E: Argument "axis" to "cumprod" has incompatible type +np.cumprod(a, out=False) # E: Argument "out" to "cumprod" has incompatible type + +np.size(a, axis=1.0) # E: Argument "axis" to "size" has incompatible type + +np.around(a, decimals=1.0) # E: No overload variant of "around" matches argument type +np.around(a, out=type) # E: No overload variant of "around" matches argument type + +np.mean(a, axis=1.0) # E: No overload variant of "mean" matches argument type +np.mean(a, out=False) # E: No overload variant of "mean" matches argument type +np.mean(a, keepdims=1.0) # E: No overload variant of "mean" matches argument type + +np.std(a, axis=1.0) # E: No overload variant of "std" matches argument type +np.std(a, out=False) # E: No overload variant of "std" matches argument type +np.std(a, ddof='test') # E: No overload variant of "std" matches argument type +np.std(a, keepdims=1.0) # E: No overload variant of "std" matches argument type + +np.var(a, axis=1.0) # E: No overload variant of "var" matches argument type +np.var(a, out=False) # E: No overload variant of "var" matches argument type +np.var(a, ddof='test') # E: No overload variant of "var" matches argument type +np.var(a, keepdims=1.0) # E: No overload variant of "var" matches argument type |