summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2024-07-05 21:04:04 +0200
committerMichał Górny <mgorny@gentoo.org>2024-07-05 21:04:04 +0200
commit13d8f37a154f23e4aa1991851eabaec11143ba6e (patch)
tree0e338831eb9ff6b7eecbc5376b736db3195254a2 /dev-python/scipy
parentdev-python/tenacity: Deselect a fragile test (diff)
downloadgentoo-13d8f37a154f23e4aa1991851eabaec11143ba6e.tar.gz
gentoo-13d8f37a154f23e4aa1991851eabaec11143ba6e.tar.bz2
gentoo-13d8f37a154f23e4aa1991851eabaec11143ba6e.zip
dev-python/scipy: Backport a test fix to 1.13.1
Closes: https://bugs.gentoo.org/935383 Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/scipy')
-rw-r--r--dev-python/scipy/files/scipy-1.13.1-test.patch46
-rw-r--r--dev-python/scipy/scipy-1.13.1.ebuild5
2 files changed, 51 insertions, 0 deletions
diff --git a/dev-python/scipy/files/scipy-1.13.1-test.patch b/dev-python/scipy/files/scipy-1.13.1-test.patch
new file mode 100644
index 000000000000..e10e8551b757
--- /dev/null
+++ b/dev-python/scipy/files/scipy-1.13.1-test.patch
@@ -0,0 +1,46 @@
+From 2f930ed7d579837423cf58f30d25d4922e4cef7c Mon Sep 17 00:00:00 2001
+From: Evgeni Burovski <evgeny.burovskiy@gmail.com>
+Date: Thu, 6 Jun 2024 10:01:58 +0300
+Subject: [PATCH] TST: linalg: bump tolerance in TestEig::test_singular
+
+Some assertions have atol/rtol configurable, and one assertion had them
+hardcoded, and that was causing tolerance problems in a Debian build with
+reference LAPACK.
+
+closes https://github.com/scipy/scipy/issues/20911
+---
+ scipy/linalg/tests/test_decomp.py | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/scipy/linalg/tests/test_decomp.py b/scipy/linalg/tests/test_decomp.py
+index 5e171965a4bd..2c4033360d16 100644
+--- a/scipy/linalg/tests/test_decomp.py
++++ b/scipy/linalg/tests/test_decomp.py
+@@ -181,7 +181,8 @@ def test_gh_3054(self):
+ assert_equal(w, np.inf)
+ assert_allclose(vr, 1)
+
+- def _check_gen_eig(self, A, B, atol_homog=1e-13, rtol_homog=1e-13):
++ def _check_gen_eig(self, A, B, atol_homog=1e-13, rtol_homog=1e-13,
++ atol=1e-13, rtol=1e-13):
+ if B is not None:
+ A, B = asarray(A), asarray(B)
+ B0 = B
+@@ -230,7 +231,7 @@ def _check_gen_eig(self, A, B, atol_homog=1e-13, rtol_homog=1e-13):
+ for i in range(res.shape[1]):
+ if np.all(isfinite(res[:, i])):
+ assert_allclose(res[:, i], 0,
+- rtol=1e-13, atol=1e-13, err_msg=msg)
++ rtol=rtol, atol=atol, err_msg=msg)
+
+ # try to consistently order eigenvalues, including complex conjugate pairs
+ w_fin = w[isfinite(w)]
+@@ -269,7 +270,7 @@ def test_singular(self):
+ [24, 35, 18, 21, 22]])
+
+ with np.errstate(all='ignore'):
+- self._check_gen_eig(A, B, atol_homog=5e-13)
++ self._check_gen_eig(A, B, atol_homog=5e-13, atol=5e-13)
+
+ def test_falker(self):
+ # Test matrices giving some Nan generalized eigenvalues.
diff --git a/dev-python/scipy/scipy-1.13.1.ebuild b/dev-python/scipy/scipy-1.13.1.ebuild
index 6858c42f2bcd..46e6f4a7ea8a 100644
--- a/dev-python/scipy/scipy-1.13.1.ebuild
+++ b/dev-python/scipy/scipy-1.13.1.ebuild
@@ -78,6 +78,11 @@ BDEPEND="
EPYTEST_XDIST=1
distutils_enable_tests pytest
+PATCHES=(
+ # https://github.com/scipy/scipy/pull/20914
+ "${FILESDIR}/${P}-test.patch"
+)
+
src_unpack() {
default