Commit b8d66bdd authored by Aaron Jones's avatar Aaron Jones

Added catch to fail nans

parent 1bf53b37
......@@ -158,7 +158,13 @@ def diff(katfile,finesse3=False):
elif zeros_check:
diffFound = True
raise DiffException("Value was supposed to be zero and was larger than " + str(diff_rel_eps), katfile)
# check for nans
elif np.any(np.isnan(rel_diff)):
diffFound = True
print('Max relative difference: np.nan')
raise DiffException("Relative differance observed as nan", katfile)
else:
mx = np.max(rel_diff)
print("All differences smaller than " + str(diff_rel_eps))
......
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