Markov* broken on armhf
authorDebian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
Sat, 6 Feb 2021 16:48:16 +0000 (16:48 +0000)
committerRebecca N. Palmer <rebecca_palmer@zoho.com>
Sat, 6 Feb 2021 16:48:16 +0000 (16:48 +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 16929164e5224841596fd5c2c07a830ca32147a9..669621683ca5c1241c38cc05294696d353e54ca0 100644 (file)
@@ -28,6 +28,9 @@ from statsmodels.tsa.regime_switching._hamilton_filter import (
     zhamilton_filter_log)
 from statsmodels.tsa.regime_switching._kim_smoother import (
     skim_smoother_log, dkim_smoother_log, ckim_smoother_log, zkim_smoother_log)
+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,
@@ -489,6 +492,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 b5c228df114c27412a6223653964f006f4821a83..8cc7356cf60970ea1de6e3a944b5922e5fbe19e3 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 e56299ec419cf2c912e0575b98b84bc6e8e1457a..ef0755f1daa0827fae905b4205d86081aaf06b2c 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__))