Changeset 8105

Show
Ignore:
Timestamp:
02/09/10 02:59:54 (7 months ago)
Author:
cdavid
Message:

ENH: handle complex input for assert_array_almost_equal_nulp.

(cherry picked from commit 6078289d9c1e69c0b043e4bb2571caafb6b2910d)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/1.4.x/numpy/testing/utils.py

    r8104 r8105  
    11091109    ref = nulp * np.spacing(np.where(ax > ay, ax, ay)) 
    11101110    if not np.all(np.abs(x-y) <= ref): 
    1111         max_nulp = np.max(nulp_diff(x, y)) 
    1112         raise AssertionError("X and Y are not equal to %d ULP "\ 
    1113                              "(max is %g)" % (nulp, max_nulp)) 
     1111        if np.iscomplexobj(x) or np.iscomplexobj(y): 
     1112            msg = "X and Y are not equal to %d ULP" % nulp 
     1113        else: 
     1114            max_nulp = np.max(nulp_diff(x, y)) 
     1115            msg = "X and Y are not equal to %d ULP (max is %g)" % (nulp, max_nulp) 
     1116        raise AssertionError(msg) 
    11141117 
    11151118def assert_array_max_ulp(a, b, maxulp=1, dtype=None):