perturbopy.test_utils.run_test.run_utils.get_tol
- perturbopy.test_utils.run_test.run_utils.get_tol(ig_n_tol, key, exact_match=False)
Extract the absolute and relative tolerances for
keyfromig_n_toldict.- Parameters:
ig_n_tol (dict) – dictionary of ignore keywords and tolerances needed to make comparison on values
key (str) – A key for the tolerance. If this key is not specified in the tolerance dict, a default tolerance will be applied.
exact_match (bool, optional) – if True, the non-default tolerance if applied to a key only if this key matches exactly with the one from the ig_n_tol; if False,
str1 in str2condition is enough. For examplephyswould be considered as a key forphysicsif exact_match is False. Default is False.:: (.. note) – The
rel tolfrom the dictionary is assumed to be in percents.
- Returns:
atol (float) – absolute tolerance for key
rtol (float) – relative tolerance for key