Skip to content

Make absolute tolerance stricter for regression tests #291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading