Adapt checks and tests to high precision Real.
This is one of the most important merge requests regarding high precision. It contains the changes which I had to make in checks and tests to make them pass. Please have a look. The summary of changes:
- python
doctest
module compares commands output by strings. It cannot perform numerical comparison. So I had to disable it for HP in 696e75d7, because it would print errors like:Expected: 2000.0 Got: mpf('2000.0')
, wherempf
is thepython.mpmath.mpf
high precision type. - Two calls of
assertEqual
are conditionally (only when HP is used) replaced byassertAlmostEqual
intests/clump.py
andtests/core.py
, becauseassertEqual
compares numbers to the last decimal place. While single bit corresponds to roughly one-third of a decimal place, so I am surprised that only two such changes were necessary. - in
checks/checkColliderConstantness.py
an interesting development. The bounds are sorted. However when the bounds are equal (same sphere for a different period) it can happen that the order after sorting has some bounds swapped. I added there a very specific check 45a465af, testing for this condition -
checks/checkLubrication.py
andchecks/checkLubricationWithRoughness.py
were too slow (up to 30 minutes slow). So when HP is used it calculates fewer iterations in 665a678a - in
checks/checkPolyhedraCrush.py
it appears that number of bodies due to crushing depends on the precision used. I am not surprised by this, hence a special check in 24030f98
The commit ff7704d5 is temporary, it is only to simulate presence of HP. Will be reverted upon rebase of !362 (merged) on this MR.
Edited by Janek Kozicki