示例#1
0
def assert_quantity_allclose(actual, desired, rtol=1.e-7, atol=None, **kwargs):
    """
    Raise an assertion if two objects are not equal up to desired tolerance.

    This is a :class:`~astropy.units.Quantity`-aware version of
    :func:`numpy.testing.assert_allclose`.
    """
    assert_allclose(
        *_unquantify_allclose_arguments(actual, desired, rtol, atol), **kwargs)
示例#2
0
文件: helper.py 项目: Cadair/astropy
def assert_quantity_allclose(actual, desired, rtol=1.e-7, atol=None,
                             **kwargs):
    """
    Raise an assertion if two objects are not equal up to desired tolerance.

    This is a :class:`~astropy.units.Quantity`-aware version of
    :func:`numpy.testing.assert_allclose`.
    """
    import numpy as np
    from astropy.units.quantity import _unquantify_allclose_arguments
    np.testing.assert_allclose(*_unquantify_allclose_arguments(
        actual, desired, rtol, atol), **kwargs)