Loosen tolerances on some tests on i386
authorDebian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
Tue, 4 Feb 2020 00:34:03 +0000 (00:34 +0000)
committerPeter Michael Green <plugwash@raspbian.org>
Tue, 4 Feb 2020 00:34:03 +0000 (00:34 +0000)
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 d13a6b13664a9181c843cb77a6865a58fd1a6189..00db5edca8524707b267855ffbda9cef87c4562d 100644 (file)
@@ -27,8 +27,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):
@@ -832,7 +833,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):
@@ -886,7 +887,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
         )