diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-06-12 20:24:52 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-06-12 20:24:52 +0000 |
commit | c0d32936d1991a2cd8a75b21b805777c18be66e9 (patch) | |
tree | ecc4dd875730f526c8c4eddd22d7bb71eadabd3a /numpy/testing/utils.py | |
parent | 844fd39844d3930ffa9c98c7d569b1f9829671ff (diff) | |
download | numpy-c0d32936d1991a2cd8a75b21b805777c18be66e9.tar.gz |
Apply patch #137
Diffstat (limited to 'numpy/testing/utils.py')
-rw-r--r-- | numpy/testing/utils.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/numpy/testing/utils.py b/numpy/testing/utils.py index 60fce8514..fcffc9002 100644 --- a/numpy/testing/utils.py +++ b/numpy/testing/utils.py @@ -16,8 +16,8 @@ def rand(*args): This only uses the standard library, so it is useful for testing purposes. """ import random - from numpy.core import zeros, Float64 - results = zeros(args,Float64) + from numpy.core import zeros, float64 + results = zeros(args, float64) f = results.flat for i in range(len(f)): f[i] = random.random() @@ -137,8 +137,8 @@ def assert_equal(actual,desired,err_msg='',verbose=True): for k in range(len(desired)): assert_equal(actual[k], desired[k], 'item=%r\n%s' % (k,err_msg), verbose) return - from numpy.core import ArrayType - if isinstance(actual, ArrayType) or isinstance(desired, ArrayType): + from numpy.core import ndarray + if isinstance(actual, ndarray) or isinstance(desired, ndarray): return assert_array_equal(actual, desired, err_msg) msg = build_err_msg(actual, desired, err_msg, verbose=verbose) assert desired == actual, msg @@ -150,8 +150,8 @@ def assert_almost_equal(actual,desired,decimal=7,err_msg='',verbose=True): The test is equivalent to abs(desired-actual) < 0.5 * 10**(-decimal) """ - from numpy.core import ArrayType - if isinstance(actual, ArrayType) or isinstance(desired, ArrayType): + from numpy.core import ndarray + if isinstance(actual, ndarray) or isinstance(desired, ndarray): return assert_array_almost_equal(actual, desired, decimal, err_msg) msg = build_err_msg(actual, desired, err_msg, verbose=verbose) assert round(abs(desired - actual),decimal) == 0, msg |