Loosen tolerances on some tests on i386
authorDebian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
Fri, 10 Jul 2020 05:46:36 +0000 (06:46 +0100)
committerRebecca N. Palmer <rebecca_palmer@zoho.com>
Fri, 10 Jul 2020 05:46:36 +0000 (06:46 +0100)
Failure log
https://buildd.debian.org/status/fetch.php?pkg=statsmodels&arch=i386&ver=0.9.0-3&stamp=1567157609&raw=0

As it only fails on i386 (not x32) and isn't far over tolerance,
I suspect different rounding due to x87 excess precision

Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Bug-Debian: https://bugs.debian.org/938949
Forwarded: no

Gbp-Pq: Name i386_loosen_test_tolerances.patch

statsmodels/tsa/statespace/tests/test_smoothing.py

index 335621fac6eeceee4bfabcef781d4e094faf6866..407423909cb61026318b99296a127e79349df2bf 100644 (file)
@@ -26,8 +26,9 @@ from statsmodels.tsa.statespace.kalman_smoother import (
     SMOOTH_UNIVARIATE)
 
 current_path = os.path.dirname(os.path.abspath(__file__))
-
-
+import sys
+import glob
+i386_looser_tolerances=len(glob.glob('/usr/lib/i386-*/'))>0 and np.log2(sys.maxsize)<=32
 class TestStatesAR3(object):
     @classmethod
     def setup_class(cls, alternate_timing=False, *args, **kwargs):
@@ -831,7 +832,7 @@ class TestMultivariateVARUnivariate(object):
     def test_forecasts_error_cov(self):
         assert_allclose(
             self.results.forecasts_error_cov.diagonal(),
-            self.desired[['F1', 'F2', 'F3']]
+            self.desired[['F1', 'F2', 'F3']],rtol=2e-7 if i386_looser_tolerances else 1e-7
         )
 
     def test_predicted_states(self):
@@ -885,7 +886,7 @@ class TestMultivariateVARUnivariate(object):
     def test_smoothed_measurement_disturbance_cov(self):
         assert_allclose(
             self.results.smoothed_measurement_disturbance_cov.diagonal(),
-            self.desired[['Veps1', 'Veps2', 'Veps3']]
+            self.desired[['Veps1', 'Veps2', 'Veps3']],rtol=2e-7 if i386_looser_tolerances else 1e-7
         )