Skip to content

Commit

Permalink
Make absolute tolerance stricter for regression tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yut23 committed Oct 18, 2024
1 parent a08adc7 commit 9d193d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyro/util/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"varerr": "one or more variables don't agree"}


def compare(data1, data2, rtol=1.e-12):
def compare(data1, data2, rtol=1.e-12, atol=1.e-13):
"""
given two CellCenterData2d objects, compare the data, zone-by-zone
and output any errors
Expand Down Expand Up @@ -59,7 +59,7 @@ def compare(data1, data2, rtol=1.e-12):
else:
print(f"{name:20s} absolute error = {abs_err:10.10g}")

if not np.allclose(d1.v(), d2.v(), rtol=rtol):
if not np.allclose(d1.v(), d2.v(), rtol=rtol, atol=atol):
result = "varerr"

return result
Expand Down

0 comments on commit 9d193d8

Please sign in to comment.