assert_values_equal#

lsst.images.tests.assert_values_equal(a, b, *, rtol=0.0, atol=0.0, equal_nan=True, label='')#

Assert that two arrays, quantities, or floats are equal or close.

On mismatch this raises an AssertionError with a concise report (count, max absolute difference, location, NaN-mismatch count) rather than dumping the arrays.

Parameters:
  • a (ndarray | Quantity | float) – First value to compare.

  • b (ndarray | Quantity | float) – Second value to compare.

  • rtol (float, default: 0.0) – Relative tolerance.

  • atol (float | Quantity, default: 0.0) – Absolute tolerance; a Quantity is converted to the unit of a, or of the quantity-valued operand when only one operand has a unit.

  • equal_nan (bool, default: True) – If True, treat NaN as equal to NaN.

  • label (str, default: '') – Prefix prepended to the failure message.

Return type:

None

This page was last modified on .