public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/statsmodels/, dev-python/statsmodels/files/
Date: Sat,  3 Jul 2021 16:06:46 +0000 (UTC)	[thread overview]
Message-ID: <1625328399.bbb9cbd7991428b52a6ec53c3e6636a55efe98be.mgorny@gentoo> (raw)

commit:     bbb9cbd7991428b52a6ec53c3e6636a55efe98be
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jul  3 15:49:53 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> 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 <mgorny <AT> 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 <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
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
 }


             reply	other threads:[~2021-07-03 16:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-03 16:06 Michał Górny [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-03-10 13:24 [gentoo-commits] repo/gentoo:master commit in: dev-python/statsmodels/, dev-python/statsmodels/files/ Michał Górny
2021-06-21  9:45 Michał Górny
2020-04-29  5:49 Patrick McLean

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1625328399.bbb9cbd7991428b52a6ec53c3e6636a55efe98be.mgorny@gentoo \
    --to=mgorny@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox