summaryrefslogtreecommitdiff
path: root/numpy/testing/utils.py
diff options
context:
space:
mode:
authorMark Wiebe <mwwiebe@gmail.com>2011-01-28 16:27:56 -0800
committerMark Wiebe <mwwiebe@gmail.com>2011-01-28 16:27:56 -0800
commit67e5476a4178de55451501cfb01794c22d340b7a (patch)
tree2a24b021001658deb92230692f8fad62e9355791 /numpy/testing/utils.py
parentcdac1209a517bf0808f12340d21ac9d334f69485 (diff)
parentaedce0eb9fa63e7dec3c865374a64e11374c284c (diff)
downloadnumpy-67e5476a4178de55451501cfb01794c22d340b7a.tar.gz
Merge branch 'new_iterator' - new iterator, ufunc update, restore 1.5 ABI
New Iterator - Read doc/neps/new-iterator-ufunc.rst. UFunc Update - Change all ufunc functions to use the new iterator. This replaces the inline buffering with iterator buffering, except for the reductions and generalized ufunc which use updateifcopy at the moment. Also adds out= and order= parameters to all ufuncs. Restore 1.5 ABI - This was done by moving the new type numbers to the end of the type enumeration, and replacing all type promotion code with a table-based approach. The ArrFuncs was restored by putting the new type cast functions into the cast dictionary, originally designed just for custom types. Conflicts: numpy/core/src/multiarray/ctors.c numpy/core/tests/test_regression.py
Diffstat (limited to 'numpy/testing/utils.py')
-rw-r--r--numpy/testing/utils.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/numpy/testing/utils.py b/numpy/testing/utils.py
index 6f18b5468..1a03f98ea 100644
--- a/numpy/testing/utils.py
+++ b/numpy/testing/utils.py
@@ -421,7 +421,7 @@ def assert_almost_equal(actual,desired,decimal=7,err_msg='',verbose=True):
usecomplex = False
msg = build_err_msg([actual, desired], err_msg, verbose=verbose,
- header='Arrays are not almost equal')
+ header=('Arrays are not almost equal to %d decimals' % decimal))
if usecomplex:
if iscomplexobj(actual):
@@ -616,7 +616,8 @@ def assert_array_compare(comparison, x, y, err_msg='', verbose=True,
names=('x', 'y'))
if not cond :
raise AssertionError(msg)
- except ValueError:
+ except ValueError as e:
+ header = 'error during assertion:\n%s\n\n%s' % (e, header)
msg = build_err_msg([x, y], err_msg, verbose=verbose, header=header,
names=('x', 'y'))
raise ValueError(msg)
@@ -771,7 +772,7 @@ def assert_array_almost_equal(x, y, decimal=6, err_msg='', verbose=True):
z = z.astype(float_) # handle object arrays
return around(z, decimal) <= 10.0**(-decimal)
assert_array_compare(compare, x, y, err_msg=err_msg, verbose=verbose,
- header='Arrays are not almost equal')
+ header=('Arrays are not almost equal to %d decimals' % decimal))
def assert_array_less(x, y, err_msg='', verbose=True):
"""