Closed kesterlester closed 3 years ago
Regarding formatting, if in doubt go with what the “Black” automatic formatter does to your code. Reduces the amount of mental effort you need to spend :)
Are your precision issues fixed by using absolute tolerance levels, and setting relative tolerances to zero?
see documentation here:
https://docs.pytest.org/en/stable/reference.html#pytest-approx
Are your precision issues fixed by using absolute tolerance levels, and setting relative tolerances to zero?
see documentation here:
https://docs.pytest.org/en/stable/reference.html#pytest-approx
No - my confusion as to why tests were failing was fixed by replacing m_parent with val in the debug/warning line. (This was something you commented on.) That change/fix made clear that the tests which were failing were failing for the right reasons.
There is a line of this test which sets a tolerance in the approx-equal command. Docs say that the default tolerance is 1e-6, but the MT2 calculator should be able to do better in this test, so I pushed it up to 1e-12 and the test still passes. However if I push this tolerance up to 1e-13 then the test fails (on my laptop -- I don't know if it fails on github or elsewhere at 1e-13). This I fund surprising as the printouts suggest that python thinks the numbers it is comparing agree to at least 1e-15 or maybe even higher, EVEN WHEN IT SAYS THE COMPARISON FAILS. This means that something fishy is happening which should be understood.