From 61f10f985e19dfe20a4d9552902625edd5b6eabb Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 21 Jun 2021 17:32:00 +0100 Subject: gentoo resync : 21.06.2021 --- dev-python/statsmodels/Manifest | 3 +- .../statsmodels-0.12.2-new-pandas-scipy.patch | 73 ++++++++++++++++++++++ dev-python/statsmodels/statsmodels-0.12.2.ebuild | 3 +- 3 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 dev-python/statsmodels/files/statsmodels-0.12.2-new-pandas-scipy.patch (limited to 'dev-python/statsmodels') diff --git a/dev-python/statsmodels/Manifest b/dev-python/statsmodels/Manifest index 0d4770bf79a3..156d49b9e01c 100644 --- a/dev-python/statsmodels/Manifest +++ b/dev-python/statsmodels/Manifest @@ -1,4 +1,5 @@ AUX statsmodels-0.11.1-tests.patch 1915 BLAKE2B 90c13595a80cf1e59e81c483746f4b7e25bbb47d03211c39fda4dc9f441b03a9e793398d88e235ab53895e3d08cf97f7080d961317c4ea3fab04e011f0e5b64b SHA512 ec7f858b1af512d0bf591d35681b8663041e08e64a6e223e56cf600316a203259cd6386d2004bf884224608945b9e4938e9d39f8370d11c8914f6b773cd2773d +AUX statsmodels-0.12.2-new-pandas-scipy.patch 2752 BLAKE2B 8608a86dd777b7e3fbcac43ddafa36535e36cdf8bfd30d362f4582c3d0b34223d9c59c8ad3a3f549225fab4b82f1eb841c998dd19befd7048d3c1ee6095d926a SHA512 edf5a93b56bda05cda7243c686af43689ed792480b938a8b618b099382612cfa5b89319e3b2d29fc7cd7335964d2404719ee1e0a1fb8098fc07e4060be152005 DIST statsmodels-0.12.2.tar.gz 17470078 BLAKE2B 7b2a17fe350489888fd05d2275b597ec7cb0f32dcea97daa5c06a973fa53a7b3af40d494c735e30cd65deec9b5dd314c0513454a7c2d2c40e22fd6de3aeb40c8 SHA512 ae4872bc7300ef564407daa8b4076fd70fc180965622ed2173871579e063e2143e000540089923fe171dbb191b7dd872077d8ba6794fe23390331375ec7ce810 -EBUILD statsmodels-0.12.2.ebuild 2015 BLAKE2B 5eaf681a369ac8ff514007caee37c4172e1861458f7cd6e26e8e99a72b433459c43f155e0b18662e4d6b24cfef699beb969e99a36a62256b58af687b66565c33 SHA512 e74f144154e59f885a4b88feda42683c7715b62e1c22607ed500d2471b51fdf2ba745a6d638c93c8859c723dce7cdf1f145d4a86f8e8e7b85dcefee7d96935db +EBUILD statsmodels-0.12.2.ebuild 2058 BLAKE2B 53540f3f3b1b29ee92098d7ba3c9b524e7150d81541ae5b44718b466d8f88c5bf37168d9616d06526c7a16802c4d30fbea2e190b19eda67029c947c6b9b67c06 SHA512 5cea9a0d3ee17f8f87e0aaf950f0555d38e4d225e9d1f66d6de836fef335ff2385aea2cf8df7f7eb35fb3384578b9c4394d15e2c3d4b5bc650dc7593139efe0e MISC metadata.xml 1343 BLAKE2B a08942814d2fd32d84c562d0d83b3e63dc2ff687808dc892a2871c0a07a100a5f379f61fd934aa3d1557d0dc899d08b57affb2e0ddb540726163166c6adddffa SHA512 6d76846584b1152e7e40e52a523157c0d99ee9addf92c2813dbe3e1886169f66cfb64b2532b24e76e4f128e12a19e147c3748716f1dbf28793118a73ad162200 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 new file mode 100644 index 000000000000..3015147fc2c5 --- /dev/null +++ b/dev-python/statsmodels/files/statsmodels-0.12.2-new-pandas-scipy.patch @@ -0,0 +1,73 @@ +From 4f32f3990fbba0ee440af47e23a9354fdb7a0285 Mon Sep 17 00:00:00 2001 +From: Kevin Sheppard +Date: Fri, 12 Mar 2021 10:52:38 +0000 +Subject: [PATCH] MAINT: Fix issues arising from future changes + +Fix issues due to changes in SciPy and pandas +--- + statsmodels/regression/tests/test_rolling.py | 6 ++++-- + statsmodels/stats/descriptivestats.py | 8 +++++++- + statsmodels/stats/stattools.py | 4 +++- + 3 files changed, 14 insertions(+), 4 deletions(-) + +diff --git a/statsmodels/regression/tests/test_rolling.py b/statsmodels/regression/tests/test_rolling.py +index 050de605f..f02e076d6 100644 +--- a/statsmodels/regression/tests/test_rolling.py ++++ b/statsmodels/regression/tests/test_rolling.py +@@ -1,5 +1,6 @@ + from io import BytesIO + from itertools import product ++import warnings + + import numpy as np + import pandas as pd +@@ -261,8 +262,9 @@ def test_plot(): + res.plot_recursive_coefficient(variables="x4") + + fig = plt.Figure() +- with pytest.warns(Warning): +- # Just silence the warning ++ # Just silence the warning ++ with warnings.catch_warnings(): ++ warnings.simplefilter("ignore") + out = res.plot_recursive_coefficient(fig=fig) + assert out is fig + res.plot_recursive_coefficient(alpha=None, figsize=(30, 7)) +diff --git a/statsmodels/stats/descriptivestats.py b/statsmodels/stats/descriptivestats.py +index 96d455ca1..d5ad2f2a5 100644 +--- a/statsmodels/stats/descriptivestats.py ++++ b/statsmodels/stats/descriptivestats.py +@@ -446,8 +446,14 @@ class Description: + else: + iqr = mean + ++ def _safe_jarque_bera(c): ++ a = np.asarray(c) ++ if a.shape[0] < 2: ++ return (np.nan,) * 4 ++ return jarque_bera(a) ++ + jb = df.apply( +- lambda x: list(jarque_bera(x.dropna())), result_type="expand" ++ lambda x: list(_safe_jarque_bera(x.dropna())), result_type="expand" + ).T + nan_mean = mean.copy() + nan_mean.loc[nan_mean == 0] = np.nan +diff --git a/statsmodels/stats/stattools.py b/statsmodels/stats/stattools.py +index d349c472d..2ee1a6e0b 100644 +--- a/statsmodels/stats/stattools.py ++++ b/statsmodels/stats/stattools.py +@@ -118,7 +118,9 @@ def jarque_bera(resids, axis=0): + where n is the number of data points, S is the sample skewness, and K is + the sample kurtosis of the data. + """ +- resids = np.asarray(resids) ++ resids = np.atleast_1d(np.asarray(resids, dtype=float)) ++ if resids.size < 2: ++ raise ValueError("resids must contain at least 2 elements") + # Calculate residual skewness and kurtosis + skew = stats.skew(resids, axis=axis) + kurtosis = 3 + stats.kurtosis(resids, axis=axis) +-- +2.32.0 + diff --git a/dev-python/statsmodels/statsmodels-0.12.2.ebuild b/dev-python/statsmodels/statsmodels-0.12.2.ebuild index d67ff026af47..9b7aafc2dc08 100644 --- a/dev-python/statsmodels/statsmodels-0.12.2.ebuild +++ b/dev-python/statsmodels/statsmodels-0.12.2.ebuild @@ -3,7 +3,7 @@ EAPI=7 -PYTHON_COMPAT=( python3_{7..9} ) +PYTHON_COMPAT=( python3_{8..9} ) inherit distutils-r1 optfeature @@ -33,6 +33,7 @@ BDEPEND=" PATCHES=( "${FILESDIR}/statsmodels-0.11.1-tests.patch" + "${FILESDIR}/${P}-new-pandas-scipy.patch" ) distutils_enable_sphinx docs \ -- cgit v1.2.3