Skip to content

Adapt checks and tests to high precision Real.

Janek Kozicki requested to merge adaptChecksAndTestsToHP into master

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:

  1. 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'), where mpf is the python.mpmath.mpf high precision type.
  2. Two calls of assertEqual are conditionally (only when HP is used) replaced by assertAlmostEqual in tests/clump.py and tests/core.py, because assertEqual 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.
  3. 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
  4. checks/checkLubrication.py and checks/checkLubricationWithRoughness.py were too slow (up to 30 minutes slow). So when HP is used it calculates fewer iterations in 665a678a
  5. 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

Merge request reports

Loading