Markov* broken on armhf
authorDebian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
Sun, 6 Feb 2022 19:08:08 +0000 (19:08 +0000)
committerRebecca N. Palmer <rebecca_palmer@zoho.com>
Sun, 6 Feb 2022 19:08:08 +0000 (19:08 +0000)
Warn on use, and xfail tests

I suspect https://github.com/statsmodels/statsmodels/pull/5826
but that improved it enough on amd64 that
reverting it isn't a good solution.

Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Forwarded: no

Gbp-Pq: Name xfail_regimeswitching_armhf.patch

statsmodels/tsa/regime_switching/markov_switching.py
statsmodels/tsa/regime_switching/tests/test_markov_autoregression.py
statsmodels/tsa/regime_switching/tests/test_markov_regression.py

index efa0c2e8a08f9ebb24910d05f05f8f9930571e58..9b0b769f727d8874cb5d558e972ab7d77d3b9d85 100644 (file)
@@ -35,6 +35,9 @@ from statsmodels.tsa.statespace.tools import (
     prepare_exog,
     _safe_cond
 )
+import platform
+import sys
+warn_rswitch_platform = "Regime switching models (Markov(Auto)Regression) can give wrong results on armhf (armv7)" if ((platform.uname()[4].startswith('arm') or platform.uname()[4].startswith('aarch')) and np.log2(sys.maxsize)<=32) else False # test results at end of https://buildd.debian.org/status/fetch.php?pkg=statsmodels&arch=armhf&ver=0.11.0-1&stamp=1580716740&raw=0 ; the use of log2 rather than 2**32 is to avoid overflow on Python 2
 
 prefix_hamilton_filter_log_map = {
     's': shamilton_filter_log, 'd': dhamilton_filter_log,
@@ -496,6 +499,8 @@ class MarkovSwitching(tsbase.TimeSeriesModel):
 
     def __init__(self, endog, k_regimes, order=0, exog_tvtp=None, exog=None,
                  dates=None, freq=None, missing='none'):
+        if warn_rswitch_platform:
+            warnings.warn(warn_rswitch_platform)
 
         # Properties
         self.k_regimes = k_regimes
index 7915281ff4310765e225def6a91229a76d2bc8c7..ea8550843b7b251636e814cbd2d8adfcdb3cb5b6 100644 (file)
@@ -15,6 +15,8 @@ import pytest
 
 from statsmodels.tools import add_constant
 from statsmodels.tsa.regime_switching import markov_autoregression
+from statsmodels.tsa.regime_switching.markov_switching import warn_rswitch_platform
+pytestmark = pytest.mark.xfail(condition=bool(warn_rswitch_platform),reason="known broken on armhf",strict=False)
 
 current_path = os.path.dirname(os.path.abspath(__file__))
 
index 551a4fc6d7892b67b63bf109d3e972b04132a5a2..79dfdd4116c1ff6b457c4eb2b6a90814bcbcb6be 100644 (file)
@@ -15,6 +15,8 @@ import pytest
 
 from statsmodels.tsa.regime_switching import (markov_switching,
                                               markov_regression)
+from statsmodels.tsa.regime_switching.markov_switching import warn_rswitch_platform
+pytestmark = pytest.mark.xfail(condition=bool(warn_rswitch_platform),reason="known broken on armhf",strict=False)
 
 
 current_path = os.path.dirname(os.path.abspath(__file__))