- qcelemental.testing.compare_values(expected, computed, label=None, *, atol=1e-06, rtol=1e-16, equal_nan=False, equal_phase=False, passnone=False, quiet=False, return_message=False, return_handler=None)[source]¶
Returns True if two floats or float arrays are element-wise equal within a tolerance.
ndarray]) – float or float array-like Reference value against which computed is compared.
ndarray]) – float or float array-like Input value to compare against expected.
float) – Absolute tolerance (see formula below).
str]) – Label for passed and error messages. Defaults to calling function name.
float) – Relative tolerance (see formula below). By default set to zero so atol dominates.
bool) – Passed to
numpy.isclose(). Compare NaN’s as equal.
bool) – Compare computed or its opposite as equal.
bool) – Return True when both expected and computed are None.
bool) – Whether to log the return message.
bool) – Whether to return tuple. See below.
Callable]) – Function to control printing, logging, raising, and returning. Specialized interception for interfacing testing systems.
- Return type:
allclose (bool) – Returns True if expected and computed are equal within tolerance; False otherwise.
message (str) – When return_message=True, also return passed or error message.
For scalar float-comparable types and for arbitrary-dimension, np.ndarray-castable, uniform-type, float-comparable types. For mixed types, use
Sets rtol to zero to match expected Psi4 behaviour, otherwise measured as:
absolute(computed - expected) <= (atol + rtol * absolute(expected))