flatsurf / surface-dynamics

Teichmüller dynamics in SageMath
https://flatsurf.github.io/surface-dynamics/
GNU General Public License v2.0
11 stars 13 forks source link

Fix CI for SageMath 9.1 #47

Closed saraedum closed 2 years ago

saraedum commented 2 years ago

Checklist

saraedum commented 2 years ago

@fchapoton I hope that this fixes the failing CI runs for your pull requests.

fchapoton commented 2 years ago

this reveals some failing doctests

saraedum commented 2 years ago

@slel @videlec

File "/usr/share/miniconda/envs/test/lib/python3.9/site-packages/surface_dynamics/interval_exchanges/cover.py", line 1091, in surface_dynamics.interval_exchanges.cover.PermutationCover.?
Failed example:
    c.lyapunov_exponents_H_plus(isotypic_decomposition=True) # abs tol 0.05
Expected:
    [[],
     [0.2857, 0.2857],
     [0.5714, 0.5714],
     [0.2857, 0.2857]]
Got:
    [[],
     [0.35299143514907344, 0.3543090645855721],
     [0.6224970232357228, 0.5916136365203184],
     [0.353330129706186, 0.35358205413175214]]
Tolerance exceeded in 5 of 6:
    0.2857 vs 0.35299143514907344, tolerance 7e-2 > 5e-2
    0.2857 vs 0.3543090645855721, tolerance 7e-2 > 5e-2
    0.5714 vs 0.6224970232357228, tolerance 6e-2 > 5e-2
    0.2857 vs 0.353330129706186, tolerance 7e-2 > 5e-2
    0.2857 vs 0.35358205413175214, tolerance 7e-2 > 5e-2

Does the expected tolerance have any real meaning here or should we just increase it to make these tests pass?

videlec commented 2 years ago

The tolerance sort of have some meaning. This is a Monte Carlo algorithm, so the only thing we can bound is in expectation. Here, it should be rather small.

Anyway, the culprit doctest was a duplicate of the one just above which has an extra parameter nb_iterations=2**19. The latter does increase the number of iterations (and improve the convergence). I just removed the duplicated doctest in 48c3807.