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 key from ig_n_tol dict.

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 str2 condition is enough. For example phys would be considered as a key for physics if exact_match is False. Default is False.

  • :: (.. note) – The rel tol from the dictionary is assumed to be in percents.

Returns:

  • atol (float) – absolute tolerance for key

  • rtol (float) – relative tolerance for key