From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 6BE49139347 for ; Sat, 3 Jul 2021 16:06:50 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 518E9E088A; Sat, 3 Jul 2021 16:06:49 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2DCF3E088A for ; Sat, 3 Jul 2021 16:06:49 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BEC6A335CD8 for ; Sat, 3 Jul 2021 16:06:47 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4C4897C1 for ; Sat, 3 Jul 2021 16:06:46 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1625328399.bbb9cbd7991428b52a6ec53c3e6636a55efe98be.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/statsmodels/, dev-python/statsmodels/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-python/statsmodels/files/statsmodels-0.12.2-new-pandas-scipy.patch dev-python/statsmodels/statsmodels-0.12.2-r1.ebuild dev-python/statsmodels/statsmodels-0.12.2.ebuild X-VCS-Directories: dev-python/statsmodels/ dev-python/statsmodels/files/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: bbb9cbd7991428b52a6ec53c3e6636a55efe98be X-VCS-Branch: master Date: Sat, 3 Jul 2021 16:06:46 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 4790ba6f-70d0-4800-940b-8b42f6da5394 X-Archives-Hash: a0b30327d2364c7c727f178a8c7a1f43 commit: bbb9cbd7991428b52a6ec53c3e6636a55efe98be Author: Michał Górny gentoo org> AuthorDate: Sat Jul 3 15:49:53 2021 +0000 Commit: Michał Górny gentoo org> CommitDate: Sat Jul 3 16:06:39 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bbb9cbd7 dev-python/statsmodels: Resolve more regressions, skip more tests Signed-off-by: Michał Górny gentoo.org> .../statsmodels-0.12.2-new-pandas-scipy.patch | 49 ++++++++++++++++++++++ ...-0.12.2.ebuild => statsmodels-0.12.2-r1.ebuild} | 7 ++-- 2 files changed, 53 insertions(+), 3 deletions(-) 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 3015147fc2c..d11cd08ecf6 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 +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 similarity index 91% rename from dev-python/statsmodels/statsmodels-0.12.2.ebuild rename to dev-python/statsmodels/statsmodels-0.12.2-r1.ebuild index 9b7aafc2dc0..6ad90c648a6 100644 --- a/dev-python/statsmodels/statsmodels-0.12.2.ebuild +++ b/dev-python/statsmodels/statsmodels-0.12.2-r1.ebuild @@ -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 }