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/pass/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/pass/fromnumeric.py')
-rw-r--r-- | numpy/tests/typing/pass/fromnumeric.py | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/numpy/tests/typing/pass/fromnumeric.py b/numpy/tests/typing/pass/fromnumeric.py index d9dd45c54..9e936e684 100644 --- a/numpy/tests/typing/pass/fromnumeric.py +++ b/numpy/tests/typing/pass/fromnumeric.py @@ -10,6 +10,7 @@ B.setflags(write=False) a = np.bool_(True) b = np.float32(1.0) c = 1.0 +d = np.array(1.0, dtype=np.float32) # writeable np.take(a, 0) np.take(b, 0) @@ -183,3 +184,77 @@ np.amin(A, axis=0) np.amin(B, axis=0) np.amin(A, keepdims=True) np.amin(B, keepdims=True) + +np.prod(a) +np.prod(b) +np.prod(c) +np.prod(A) +np.prod(B) +np.prod(a, dtype=None) +np.prod(A, dtype=None) +np.prod(A, axis=0) +np.prod(B, axis=0) +np.prod(A, keepdims=True) +np.prod(B, keepdims=True) +np.prod(b, out=d) +np.prod(B, out=d) + +np.cumprod(a) +np.cumprod(b) +np.cumprod(c) +np.cumprod(A) +np.cumprod(B) + +np.ndim(a) +np.ndim(b) +np.ndim(c) +np.ndim(A) +np.ndim(B) + +np.size(a) +np.size(b) +np.size(c) +np.size(A) +np.size(B) + +np.around(a) +np.around(b) +np.around(c) +np.around(A) +np.around(B) + +np.mean(a) +np.mean(b) +np.mean(c) +np.mean(A) +np.mean(B) +np.mean(A, axis=0) +np.mean(B, axis=0) +np.mean(A, keepdims=True) +np.mean(B, keepdims=True) +np.mean(b, out=d) +np.mean(B, out=d) + +np.std(a) +np.std(b) +np.std(c) +np.std(A) +np.std(B) +np.std(A, axis=0) +np.std(B, axis=0) +np.std(A, keepdims=True) +np.std(B, keepdims=True) +np.std(b, out=d) +np.std(B, out=d) + +np.var(a) +np.var(b) +np.var(c) +np.var(A) +np.var(B) +np.var(A, axis=0) +np.var(B, axis=0) +np.var(A, keepdims=True) +np.var(B, keepdims=True) +np.var(b, out=d) +np.var(B, out=d) |