[Numpy-discussion] actual, desired versus x, y
Keith Goodman
kwgoodman@gmail....
Thu Jun 3 12:07:01 CDT 2010
Some of the numpy.testing assert functions call the input x and y,
others call it actual and desired:
>> actual = np.array([1+1j])
>> desired = np.array([2+2j])
>> assert_almost_equal(actual, desired)
<snip>
AssertionError: Items are not equal:
ACTUAL: [ 1.+1.j]
DESIRED: [ 2.+2.j]
>> assert_almost_equal(actual.real, desired.real)
<snip>
(mismatch 100.0%)
x: array([ 1.])
y: array([ 2.])
I like the actual and desired, helps me remember which is which.
BTW: numpy.testing is very handy!
More information about the NumPy-Discussion
mailing list