scipp.testing.assertions.assert_allclose#

scipp.testing.assertions.assert_allclose(a, b, rtol=None, atol=None, **kwargs)#

Raise an AssertionError if two objects don’t have similar values or if their other properties are not identical.

Parameters:
  • a (TypeVar(_T, Variable, DataArray)) – The actual object to check.

  • b (TypeVar(_T, Variable, DataArray)) – The desired, expected object.

  • rtol (Optional[Variable], default: None) – Tolerance value relative (to b). Can be a scalar or non-scalar. Cannot have variances. Defaults to scalar 1e-7 if unset.

  • atol (Optional[Variable], default: None) – Tolerance value absolute. Can be a scalar or non-scalar. Cannot have variances. Defaults to scalar 0 if unset and takes units from y arg.

  • kwargs (Any) – Additional arguments to pass to numpy.testing.assert_allclose() which is used for comparing data.

Raises:

AssertionError – If the objects are not identical.

Return type:

None