Skip to content
Snippets Groups Projects
Commit f365ca9a authored by Johanna Zijderveld's avatar Johanna Zijderveld
Browse files

add tolerance option to compare_dicts

parent 20d2920f
No related branches found
No related tags found
1 merge request!4Interface refactoring
......@@ -20,6 +20,6 @@ def add_tb(tb1, tb2):
return {k: tb1.get(k, 0) + tb2.get(k, 0) for k in frozenset(tb1) | frozenset(tb2)}
def compare_dicts(dict1, dict2):
def compare_dicts(dict1, dict2, atol=1e-10):
for key in dict1.keys():
assert np.allclose(dict1[key], dict2[key])
assert np.allclose(dict1[key], dict2[key], atol=atol)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment