commit:     13d8f37a154f23e4aa1991851eabaec11143ba6e
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jul  5 19:04:04 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jul  5 19:04:04 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=13d8f37a

dev-python/scipy: Backport a test fix to 1.13.1

Closes: https://bugs.gentoo.org/935383
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/scipy/files/scipy-1.13.1-test.patch | 46 ++++++++++++++++++++++++++
 dev-python/scipy/scipy-1.13.1.ebuild           |  5 +++
 2 files changed, 51 insertions(+)

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.burovs...@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
 

Reply via email to