- qcelemental.compare_recursive(expected, computed, label=None, *, atol=1e-06, rtol=1e-16, forgive=None, equal_phase=False, quiet=False, return_message=False, return_handler=None)[source]¶
Recursively compares nested structures such as dictionaries and lists.
ProtoModel]) – Reference value against which computed is compared. Dict may be of any depth but should contain Plain Old Data.
ProtoModel]) – Input value to compare against expected. Dict may be of any depth but should contain Plain Old Data.
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.
str]]) – Keys in top level which may change between expected and computed without triggering failure.
List]) – Compare computed or its opposite as equal.
bool) – Whether to log the return message.
bool) – Whether to return tuple. See below.
- 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.
absolute(computed - expected) <= (atol + rtol * absolute(expected))