summaryrefslogtreecommitdiff
path: root/numpy/testing/_private/utils.py
diff options
context:
space:
mode:
authorMark Harfouche <mark.harfouche@gmail.com>2019-05-12 12:57:55 -0400
committerMark Harfouche <mark.harfouche@gmail.com>2019-05-12 12:57:55 -0400
commit8c3411a334d8a46b46d3148b96ecb4dfcd4e3c7b (patch)
tree181ea94c764c5f15b1c5c12a2de7c68526881663 /numpy/testing/_private/utils.py
parente6b68e55ab1cfa66ae046ccc949b557a94a7c366 (diff)
downloadnumpy-8c3411a334d8a46b46d3148b96ecb4dfcd4e3c7b.tar.gz
Fixup: address eric-wieser's comments
Diffstat (limited to 'numpy/testing/_private/utils.py')
-rw-r--r--numpy/testing/_private/utils.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/numpy/testing/_private/utils.py b/numpy/testing/_private/utils.py
index 3953439f0..75685f7fd 100644
--- a/numpy/testing/_private/utils.py
+++ b/numpy/testing/_private/utils.py
@@ -20,8 +20,7 @@ from warnings import WarningMessage
import pprint
from numpy.core import(
- intp, float32, empty, arange, array_repr, ndarray, isnat, array,
- logical_not)
+ intp, float32, empty, arange, array_repr, ndarray, isnat, array)
from numpy.lib.utils import deprecate
if sys.version_info[0] >= 3:
@@ -785,7 +784,7 @@ def assert_array_compare(comparison, x, y, err_msg='', verbose=True,
if isinstance(val, bool):
cond = val
- reduced = array([0])
+ reduced = array(val)
else:
reduced = val.ravel()
cond = reduced.all()
@@ -795,8 +794,7 @@ def assert_array_compare(comparison, x, y, err_msg='', verbose=True,
# do not trigger a failure (np.ma.masked != True evaluates as
# np.ma.masked, which is falsy).
if cond != True:
- logical_not(reduced, out=reduced)
- mismatch = 100.0 * reduced.sum(dtype=intp) / ox.size
+ mismatch = 100. * (reduced.size - reduced.sum(dtype=intp)) / ox.size
remarks = ['Mismatch: {:.3g}%'.format(mismatch)]
with errstate(invalid='ignore', divide='ignore'):