Gentoo Archives: gentoo-commits

From: Andrew Ammerlaan <andrewammerlaan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/statsmodels/files/
Date: Thu, 12 May 2022 14:17:22
Message-Id: 1652365005.fdd4806b2335243519f86233a64110c4a9284ba0.andrewammerlaan@gentoo
1 commit: fdd4806b2335243519f86233a64110c4a9284ba0
2 Author: Michael Mair-Keimberger <mmk <AT> levelnine <DOT> at>
3 AuthorDate: Tue May 10 18:01:22 2022 +0000
4 Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
5 CommitDate: Thu May 12 14:16:45 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fdd4806b
7
8 dev-python/statsmodels: remove unused patch(es)
9
10 Package-Manager: Portage-3.0.30, Repoman-3.0.3
11 Signed-off-by: Michael Mair-Keimberger <mmk <AT> levelnine.at>
12 Closes: https://github.com/gentoo/gentoo/pull/25426
13 Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
14
15 .../files/statsmodels-0.11.1-tests.patch | 35 ------
16 .../statsmodels-0.12.2-new-pandas-scipy.patch | 122 ---------------------
17 2 files changed, 157 deletions(-)
18
19 diff --git a/dev-python/statsmodels/files/statsmodels-0.11.1-tests.patch b/dev-python/statsmodels/files/statsmodels-0.11.1-tests.patch
20 deleted file mode 100644
21 index 9a1a258d0779..000000000000
22 --- a/dev-python/statsmodels/files/statsmodels-0.11.1-tests.patch
23 +++ /dev/null
24 @@ -1,35 +0,0 @@
25 -diff -ur statsmodels-0.11.1.orig/statsmodels/base/tests/test_penalized.py statsmodels-0.11.1/statsmodels/base/tests/test_penalized.py
26 ---- statsmodels-0.11.1.orig/statsmodels/base/tests/test_penalized.py 2020-04-28 22:02:47.150938650 -0700
27 -+++ statsmodels-0.11.1/statsmodels/base/tests/test_penalized.py 2020-04-28 22:03:24.468704937 -0700
28 -@@ -73,6 +73,7 @@
29 - y = np.random.poisson(mu)
30 - return y
31 -
32 -+ @pytest.mark.skip("Broken on all impls")
33 - def test_params_table(self):
34 - res1 = self.res1
35 - res2 = self.res2
36 -@@ -380,9 +381,6 @@
37 - bse = np.array([0.028126650444581985, 0.033099984564283147,
38 - 0.033184585514904545, 0.034282504130503301])
39 - assert_allclose(res2.params[:self.k_nonzero], params, atol=1e-5)
40 -- assert_allclose(res2.bse[:self.k_nonzero], bse, rtol=5e-6)
41 -- assert_allclose(res1.params[:self.k_nonzero], params, atol=1e-5)
42 -- assert_allclose(res1.bse[:self.k_nonzero], bse, rtol=5e-6)
43 -
44 -
45 - # the following classes are copies of Poisson with model adjustments
46 -Only in statsmodels-0.11.1/statsmodels/base/tests: test_penalized.py.orig
47 -diff -ur statsmodels-0.11.1.orig/statsmodels/tsa/statespace/tests/test_structural.py statsmodels-0.11.1/statsmodels/tsa/statespace/tests/test_structural.py
48 ---- statsmodels-0.11.1.orig/statsmodels/tsa/statespace/tests/test_structural.py 2020-04-28 22:02:47.207938293 -0700
49 -+++ statsmodels-0.11.1/statsmodels/tsa/statespace/tests/test_structural.py 2020-04-28 22:04:02.871464429 -0700
50 -@@ -243,7 +243,7 @@
51 - run_ucm('rtrend_ar1', use_exact_diffuse=True)
52 -
53 -
54 --@×××××××××××.slow
55 -+@×××××××××××.skip("Fails")
56 - def test_lltrend_cycle_seasonal_reg_ar1(close_figures):
57 - run_ucm('lltrend_cycle_seasonal_reg_ar1_approx_diffuse')
58 - run_ucm('lltrend_cycle_seasonal_reg_ar1', use_exact_diffuse=True)
59 -Only in statsmodels-0.11.1/statsmodels/tsa/statespace/tests: .test_structural.py.un~
60
61 diff --git a/dev-python/statsmodels/files/statsmodels-0.12.2-new-pandas-scipy.patch b/dev-python/statsmodels/files/statsmodels-0.12.2-new-pandas-scipy.patch
62 deleted file mode 100644
63 index d11cd08ecf6f..000000000000
64 --- a/dev-python/statsmodels/files/statsmodels-0.12.2-new-pandas-scipy.patch
65 +++ /dev/null
66 @@ -1,122 +0,0 @@
67 -From 4f32f3990fbba0ee440af47e23a9354fdb7a0285 Mon Sep 17 00:00:00 2001
68 -From: Kevin Sheppard <kevin.sheppard@×××××.com>
69 -Date: Fri, 12 Mar 2021 10:52:38 +0000
70 -Subject: [PATCH] MAINT: Fix issues arising from future changes
71 -
72 -Fix issues due to changes in SciPy and pandas
73 ----
74 - statsmodels/regression/tests/test_rolling.py | 6 ++++--
75 - statsmodels/stats/descriptivestats.py | 8 +++++++-
76 - statsmodels/stats/stattools.py | 4 +++-
77 - 3 files changed, 14 insertions(+), 4 deletions(-)
78 -
79 -diff --git a/statsmodels/regression/tests/test_rolling.py b/statsmodels/regression/tests/test_rolling.py
80 -index 050de605f..f02e076d6 100644
81 ---- a/statsmodels/regression/tests/test_rolling.py
82 -+++ b/statsmodels/regression/tests/test_rolling.py
83 -@@ -1,5 +1,6 @@
84 - from io import BytesIO
85 - from itertools import product
86 -+import warnings
87 -
88 - import numpy as np
89 - import pandas as pd
90 -@@ -261,8 +262,9 @@ def test_plot():
91 - res.plot_recursive_coefficient(variables="x4")
92 -
93 - fig = plt.Figure()
94 -- with pytest.warns(Warning):
95 -- # Just silence the warning
96 -+ # Just silence the warning
97 -+ with warnings.catch_warnings():
98 -+ warnings.simplefilter("ignore")
99 - out = res.plot_recursive_coefficient(fig=fig)
100 - assert out is fig
101 - res.plot_recursive_coefficient(alpha=None, figsize=(30, 7))
102 -diff --git a/statsmodels/stats/descriptivestats.py b/statsmodels/stats/descriptivestats.py
103 -index 96d455ca1..d5ad2f2a5 100644
104 ---- a/statsmodels/stats/descriptivestats.py
105 -+++ b/statsmodels/stats/descriptivestats.py
106 -@@ -446,8 +446,14 @@ class Description:
107 - else:
108 - iqr = mean
109 -
110 -+ def _safe_jarque_bera(c):
111 -+ a = np.asarray(c)
112 -+ if a.shape[0] < 2:
113 -+ return (np.nan,) * 4
114 -+ return jarque_bera(a)
115 -+
116 - jb = df.apply(
117 -- lambda x: list(jarque_bera(x.dropna())), result_type="expand"
118 -+ lambda x: list(_safe_jarque_bera(x.dropna())), result_type="expand"
119 - ).T
120 - nan_mean = mean.copy()
121 - nan_mean.loc[nan_mean == 0] = np.nan
122 -diff --git a/statsmodels/stats/stattools.py b/statsmodels/stats/stattools.py
123 -index d349c472d..2ee1a6e0b 100644
124 ---- a/statsmodels/stats/stattools.py
125 -+++ b/statsmodels/stats/stattools.py
126 -@@ -118,7 +118,9 @@ def jarque_bera(resids, axis=0):
127 - where n is the number of data points, S is the sample skewness, and K is
128 - the sample kurtosis of the data.
129 - """
130 -- resids = np.asarray(resids)
131 -+ resids = np.atleast_1d(np.asarray(resids, dtype=float))
132 -+ if resids.size < 2:
133 -+ raise ValueError("resids must contain at least 2 elements")
134 - # Calculate residual skewness and kurtosis
135 - skew = stats.skew(resids, axis=axis)
136 - kurtosis = 3 + stats.kurtosis(resids, axis=axis)
137 ---
138 -2.32.0
139 -
140 -From a9e21aef508ea98da8c5889547b8e5748986dae1 Mon Sep 17 00:00:00 2001
141 -From: Kevin Sheppard <kevin.k.sheppard@×××××.com>
142 -Date: Wed, 7 Apr 2021 09:52:25 +0100
143 -Subject: [PATCH] MAINT: Fix descriptive stats with extension dtypes
144 -
145 -Add special path for extension dtypes to remove N/A
146 ----
147 - statsmodels/stats/descriptivestats.py | 17 +++++++++++++++--
148 - 1 file changed, 15 insertions(+), 2 deletions(-)
149 -
150 -diff --git a/statsmodels/stats/descriptivestats.py b/statsmodels/stats/descriptivestats.py
151 -index d5ad2f2a5..0fd3eb542 100644
152 ---- a/statsmodels/stats/descriptivestats.py
153 -+++ b/statsmodels/stats/descriptivestats.py
154 -@@ -441,8 +441,20 @@ class Description:
155 - loc = count > 0
156 - mode_freq = np.full(mode.shape[0], np.nan)
157 - mode_freq[loc] = mode_counts[loc] / count.loc[loc]
158 -+ # TODO: Workaround for pandas AbstractMethodError in extension
159 -+ # types. Remove when quantile is supported for these
160 -+ _df = df
161 -+ try:
162 -+ from pandas.api.types import is_extension_array_dtype
163 -+ _df = df.copy()
164 -+ for col in df:
165 -+ if is_extension_array_dtype(df[col].dtype):
166 -+ _df[col] = _df[col].astype(object).fillna(np.nan)
167 -+ except ImportError:
168 -+ pass
169 -+
170 - if df.shape[1] > 0:
171 -- iqr = df.quantile(0.75) - df.quantile(0.25)
172 -+ iqr = _df.quantile(0.75) - _df.quantile(0.25)
173 - else:
174 - iqr = mean
175 -
176 -@@ -493,7 +505,8 @@ class Description:
177 - return results_df
178 - # Pandas before 1.0 cannot handle empty DF
179 - if df.shape[1] > 0:
180 -- perc = df.quantile(self._percentiles / 100).astype(float)
181 -+ # TODO: Remove when extension types support quantile
182 -+ perc = _df.quantile(self._percentiles / 100).astype(float)
183 - else:
184 - perc = pd.DataFrame(index=self._percentiles / 100, dtype=float)
185 - if np.all(np.floor(100 * perc.index) == (100 * perc.index)):
186 ---
187 -2.32.0
188 -