diff options
author | Bas van Beek <43369155+BvB93@users.noreply.github.com> | 2020-06-23 07:10:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-22 22:10:21 -0700 |
commit | dda8c852e7e968730c8fbccbf46b9121694194f1 (patch) | |
tree | a3b50f6d9ce7036216935b4488700f3a7acf6139 /numpy/tests/typing/fail/fromnumeric.py | |
parent | 28895456f147bc6e78f9366b75d1897bbc7ac3fa (diff) | |
download | numpy-dda8c852e7e968730c8fbccbf46b9121694194f1.tar.gz |
ENH: Added annotations to 8 functions from np.core.fromnumeric (#16647)
Newly annotated functions:
* `clip`
* `sum`
* `all`
* `any`
* `cumsum`
* `ptp`
* `amax`
* `amin`
Diffstat (limited to 'numpy/tests/typing/fail/fromnumeric.py')
-rw-r--r-- | numpy/tests/typing/fail/fromnumeric.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/numpy/tests/typing/fail/fromnumeric.py b/numpy/tests/typing/fail/fromnumeric.py index 7455ce722..66f8a89d0 100644 --- a/numpy/tests/typing/fail/fromnumeric.py +++ b/numpy/tests/typing/fail/fromnumeric.py @@ -89,3 +89,38 @@ np.ravel(a, order="bob") # E: Argument "order" to "ravel" has incompatible type np.compress( [True], A, axis=1.0 # E: Argument "axis" to "compress" has incompatible type ) + +np.clip(a, 1, 2, out=1) # E: No overload variant of "clip" matches argument type +np.clip(1, None, None) # E: No overload variant of "clip" matches argument type + +np.sum(a, axis=1.0) # E: No overload variant of "sum" matches argument type +np.sum(a, keepdims=1.0) # E: No overload variant of "sum" matches argument type +np.sum(a, initial=[1]) # E: No overload variant of "sum" matches argument type + +np.all(a, axis=1.0) # E: No overload variant of "all" matches argument type +np.all(a, keepdims=1.0) # E: No overload variant of "all" matches argument type +np.all(a, out=1.0) # E: No overload variant of "all" matches argument type + +np.any(a, axis=1.0) # E: No overload variant of "any" matches argument type +np.any(a, keepdims=1.0) # E: No overload variant of "any" matches argument type +np.any(a, out=1.0) # E: No overload variant of "any" matches argument type + +np.cumsum(a, axis=1.0) # E: Argument "axis" to "cumsum" has incompatible type +np.cumsum(a, dtype=1.0) # E: Argument "dtype" to "cumsum" has incompatible type +np.cumsum(a, out=1.0) # E: Argument "out" to "cumsum" has incompatible type + +np.ptp(a, axis=1.0) # E: No overload variant of "ptp" matches argument type +np.ptp(a, keepdims=1.0) # E: No overload variant of "ptp" matches argument type +np.ptp(a, out=1.0) # E: No overload variant of "ptp" matches argument type + +np.amax(a, axis=1.0) # E: No overload variant of "amax" matches argument type +np.amax(a, keepdims=1.0) # E: No overload variant of "amax" matches argument type +np.amax(a, out=1.0) # E: No overload variant of "amax" matches argument type +np.amax(a, initial=[1.0]) # E: No overload variant of "amax" matches argument type +np.amax(a, where=[1.0]) # E: List item 0 has incompatible type + +np.amin(a, axis=1.0) # E: No overload variant of "amin" matches argument type +np.amin(a, keepdims=1.0) # E: No overload variant of "amin" matches argument type +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 |