fatf.utils.testing.transparency.is_explanation_equal_dict

fatf.utils.testing.transparency.is_explanation_equal_dict(dict1: Dict[str, Dict[Union[str, int], Union[Iterable[float], float]]], dict2: Dict[str, Dict[Union[str, int], Union[Iterable[float], float]]], atol: float = 0.001) → bool[source]

Tests if the two dictionaries of a given structure are equal.

New in version 0.0.2.

The both of the input parameters must be a dictionary with string keys and dictionary values. The latter one has strings or integers as its keys and numbers or number iterables (to be compared with given absolute tolerance) as its values.

The keys in the outer and inner dictionaries must match exactly, while the numbers only need to be approximately (atol) equal.

Parameters
dict1Dictionary[string,Dictionary[Union[string, integer], Union[Iterable[float], float]]]

The first dictionary to be compared.

dict2Dictionary[string,Dictionary[Union[string, integer], Union[Iterable[float], float]]]

The second dictionary to be compared.

atolfloat, optional (default=0.001)

The absolute tolerance between each two matching numbers in the inner dictionaries.

Returns
equalboolean

True if the dictionaries are the same, False otherwise.