Raise an assertion if two objects are not equal up to desired tolerance.
The test is equivalent to allclose(actual, desired, rtol, atol). It compares the difference between actual and desired to atol + rtol * abs(desired).
Parameters: | actual : array_like
desired : array_like
rtol : float, optional
atol : float, optional
err_msg : str, optional
verbose : bool, optional
|
---|---|
Raises: | AssertionError :
|
Examples
>>> x = [1e-5, 1e-3, 1e-1]
>>> y = np.arccos(np.cos(x))
>>> assert_allclose(x, y, rtol=1e-5, atol=0)