Commit f258503f authored by Carsten Eie Frigaard's avatar Carsten Eie Frigaard
Browse files

fixed_broken_AssertInRange

parent f3a6ad26
...@@ -173,8 +173,8 @@ def AssertInRange(x, expected, eps=1E-9, autoconverttofloat=True, verbose=0): ...@@ -173,8 +173,8 @@ def AssertInRange(x, expected, eps=1E-9, autoconverttofloat=True, verbose=0):
absdiff = np.fabs(x-expected) absdiff = np.fabs(x-expected)
if verbose > 0: if verbose > 0:
print(f"CheckInRange(x={x}, expected={expected}, eps={eps}: x in [{x0}; {x1}] => {ok}") print(f"CheckInRange(x={x}, expected={expected}, eps={eps}: x in [{x0}; {x1}] => {ok}")
assert ok, f"x={x} is not within the range [{x0}; {x1}] for eps={eps}, got eps={absdiff}" assert ok, f"x={x} is not within the range [{x0}; {x1}] for eps={eps}, got eps={absdiff}"
def InRange(x, expected ,eps=1E-9, verbose=0): def InRange(x, expected ,eps=1E-9, verbose=0):
try: try:
AssertInRange(x, expected, eps, True, verbose) AssertInRange(x, expected, eps, True, verbose)
......
Supports Markdown
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