Commit 09506858 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

Merge branch 'fixup_assertion_nifty8' into 'NIFTy_8'

Test for domain equality Nifty8

See merge request !691
parents 5cf30018 80b846e6
Pipeline #111643 passed with stages
in 31 minutes and 31 seconds
......@@ -136,6 +136,8 @@ def check_operator(op, loc, tol=1e-12, ntries=100, perf_check=True,
def assert_allclose(f1, f2, atol=0, rtol=1e-7):
if isinstance(f1, Field):
return np.testing.assert_allclose(f1.val, f2.val, atol=atol, rtol=rtol)
if f1.domain is not f2.domain:
raise AssertionError
for key, val in f1.items():
assert_allclose(val, f2[key], atol=atol, rtol=rtol)
......@@ -143,6 +145,8 @@ def assert_allclose(f1, f2, atol=0, rtol=1e-7):
def assert_equal(f1, f2):
if isinstance(f1, Field):
return np.testing.assert_equal(f1.val, f2.val)
if f1.domain is not f2.domain:
raise AssertionError
for key, val in f1.items():
assert_equal(val, f2[key])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment