Use full double precision in MFILE output#3130
Conversation
9ea654d to
e0bc01f
Compare
timothy-nunn
left a comment
There was a problem hiding this comment.
@jonmaddock I'll approve this but won't merge it since you have not yet requested review. Feel free to merge it.
c23e3ad to
c166e14
Compare
|
Hi Tim, I've made some changes regarding the regression tolerance that I think are worth you reviewing. Because we've now got full precision in the MFILE.DAT output, there's some floating-point discrepancy between running the regression test locally and on the CI. So the reference (run on the CI (tracker)) would disagree with local (explicitly-requested 0% tolerance) running due to full precision assertions. I've decided to go back to pytest's |
timothy-nunn
left a comment
There was a problem hiding this comment.
This new method does not appear to respect the --reg-tolerance as exactly as it should.
E.g. I made changes to Cost c25 in the source by multiplying the output value to check the test suite respected the default 5% tolerance. The old code would error as soon as I multiplied by anything ober 1.05, e.g. 1.051.
However, the new code using approx does not fail when multiplying by 1.051, 1.052... it fails at 1.053.
(note I did these tests using both a remote reference MFile and by setting a local one to be the reference: reference_mfile_location = INPUT_FILES_FOLDER / "large_tokamak.MFILE.DAT").
Causes failures due to floating-point discrepancies between local and CI. Use pytest.approx for sensible relative and absolute difference assertions.
1b8e856 to
7996f55
Compare
|
Thanks for testing this! I think the reason was due to me using |
Use full precision of double float in MFILE output; required for precise solution vectors and reliability analysis studies.