def allclose_phase(a, b, atol=0.001):
    'Testing phase.\n    Remember that a small error in complex value may lead to a large phase difference\n    if the norm is very small.\n\n    Therefore, it makes more sense to test it on the complex value itself rather than breaking it down to phase.\n\n    '
    np.testing.assert_allclose(np.sin(a), np.sin(b), atol=atol)
    np.testing.assert_allclose(np.cos(a), np.cos(b), atol=atol)
Testing phase.
Remember that a small error in complex value may lead to a large phase difference
if the norm is very small.

Therefore, it makes more sense to test it on the complex value itself rather than breaking it down to phase.
def allclose_phase(a, b, atol=0.001):
    'Testing phase.\n    Remember that a small error in complex value may lead to a large phase difference\n    if the norm is very small.\n\n    Therefore, it makes more sense to test it on the complex value itself rather than breaking it down to phase.\n\n    '
    np.testing.assert_allclose(np.sin(a), np.sin(b), atol=atol)
    np.testing.assert_allclose(np.cos(a), np.cos(b), atol=atol)