diff options
Diffstat (limited to 'dev-python/statsmodels')
-rw-r--r-- | dev-python/statsmodels/Manifest | 4 | ||||
-rw-r--r-- | dev-python/statsmodels/files/statsmodels-0.12.2-new-pandas-scipy.patch | 49 | ||||
-rw-r--r-- | dev-python/statsmodels/statsmodels-0.12.2-r1.ebuild (renamed from dev-python/statsmodels/statsmodels-0.12.2.ebuild) | 9 |
3 files changed, 56 insertions, 6 deletions
diff --git a/dev-python/statsmodels/Manifest b/dev-python/statsmodels/Manifest index 156d49b9e01c..e82f9afd9050 100644 --- a/dev-python/statsmodels/Manifest +++ b/dev-python/statsmodels/Manifest @@ -1,5 +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 +AUX statsmodels-0.12.2-new-pandas-scipy.patch 4730 BLAKE2B 2543000c15af63874a8d23ce8ef998e5a29ec8a6181181d22f84691cd6e258749dc202140d73d663d0a9f16cec5097df93d2e40e832e324a391f45f91613ea44 SHA512 51393795a79dda5a7d2a02b4ff7c0a0c669559774114ce5aa7030393eb25747671569331dcc48be9cae7dd98d53a95fd0368dd999e35619295182ddc434c49c5 DIST statsmodels-0.12.2.tar.gz 17470078 BLAKE2B 7b2a17fe350489888fd05d2275b597ec7cb0f32dcea97daa5c06a973fa53a7b3af40d494c735e30cd65deec9b5dd314c0513454a7c2d2c40e22fd6de3aeb40c8 SHA512 ae4872bc7300ef564407daa8b4076fd70fc180965622ed2173871579e063e2143e000540089923fe171dbb191b7dd872077d8ba6794fe23390331375ec7ce810 -EBUILD statsmodels-0.12.2.ebuild 2058 BLAKE2B 53540f3f3b1b29ee92098d7ba3c9b524e7150d81541ae5b44718b466d8f88c5bf37168d9616d06526c7a16802c4d30fbea2e190b19eda67029c947c6b9b67c06 SHA512 5cea9a0d3ee17f8f87e0aaf950f0555d38e4d225e9d1f66d6de836fef335ff2385aea2cf8df7f7eb35fb3384578b9c4394d15e2c3d4b5bc650dc7593139efe0e +EBUILD statsmodels-0.12.2-r1.ebuild 2091 BLAKE2B fdd878e9b9c493b46582c2a487911caf80e1f769dcf826d5dcef3bd63cb536a9a1143de9a8208bd42313f17a884d9a1a7b2c86faafaf1bdbdbaa4eb4e6b3b2c0 SHA512 150b64c3e004ed03cbc01dc16edd66f781920a303312016d8e15245fd4776386adf207af0c1e682d95b3e52922ef08dc5fc6d08fd8a6229e55803d1d6e2e5495 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 index 3015147fc2c5..d11cd08ecf6f 100644 --- 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 @@ -71,3 +71,52 @@ index d349c472d..2ee1a6e0b 100644 -- 2.32.0 +From a9e21aef508ea98da8c5889547b8e5748986dae1 Mon Sep 17 00:00:00 2001 +From: Kevin Sheppard <kevin.k.sheppard@gmail.com> +Date: Wed, 7 Apr 2021 09:52:25 +0100 +Subject: [PATCH] MAINT: Fix descriptive stats with extension dtypes + +Add special path for extension dtypes to remove N/A +--- + statsmodels/stats/descriptivestats.py | 17 +++++++++++++++-- + 1 file changed, 15 insertions(+), 2 deletions(-) + +diff --git a/statsmodels/stats/descriptivestats.py b/statsmodels/stats/descriptivestats.py +index d5ad2f2a5..0fd3eb542 100644 +--- a/statsmodels/stats/descriptivestats.py ++++ b/statsmodels/stats/descriptivestats.py +@@ -441,8 +441,20 @@ class Description: + loc = count > 0 + mode_freq = np.full(mode.shape[0], np.nan) + mode_freq[loc] = mode_counts[loc] / count.loc[loc] ++ # TODO: Workaround for pandas AbstractMethodError in extension ++ # types. Remove when quantile is supported for these ++ _df = df ++ try: ++ from pandas.api.types import is_extension_array_dtype ++ _df = df.copy() ++ for col in df: ++ if is_extension_array_dtype(df[col].dtype): ++ _df[col] = _df[col].astype(object).fillna(np.nan) ++ except ImportError: ++ pass ++ + if df.shape[1] > 0: +- iqr = df.quantile(0.75) - df.quantile(0.25) ++ iqr = _df.quantile(0.75) - _df.quantile(0.25) + else: + iqr = mean + +@@ -493,7 +505,8 @@ class Description: + return results_df + # Pandas before 1.0 cannot handle empty DF + if df.shape[1] > 0: +- perc = df.quantile(self._percentiles / 100).astype(float) ++ # TODO: Remove when extension types support quantile ++ perc = _df.quantile(self._percentiles / 100).astype(float) + else: + perc = pd.DataFrame(index=self._percentiles / 100, dtype=float) + if np.all(np.floor(100 * perc.index) == (100 * perc.index)): +-- +2.32.0 + diff --git a/dev-python/statsmodels/statsmodels-0.12.2.ebuild b/dev-python/statsmodels/statsmodels-0.12.2-r1.ebuild index 9b7aafc2dc08..cb5be6cfc648 100644 --- a/dev-python/statsmodels/statsmodels-0.12.2.ebuild +++ b/dev-python/statsmodels/statsmodels-0.12.2-r1.ebuild @@ -3,7 +3,7 @@ EAPI=7 -PYTHON_COMPAT=( python3_{8..9} ) +PYTHON_COMPAT=( python3_{8..10} ) inherit distutils-r1 optfeature @@ -51,9 +51,10 @@ python_prepare_all() { export MPLCONFIGDIR="${T}" printf -- 'backend : Agg\n' > "${MPLCONFIGDIR}"/matplotlibrc || die - # these tests require internet - sed -i -e 's:test_results_on_the:_&:' \ - statsmodels/stats/tests/test_dist_dependant_measures.py || die + sed -e 's:test_combine:_&:' \ + -i statsmodels/imputation/tests/test_mice.py || die + sed -e 's:test_mixedlm:_&:' \ + -i statsmodels/stats/tests/test_mediation.py || die distutils-r1_python_prepare_all } |