MAINT: fix umfpack test failure with numpy 1.23
authorRalf Gommers <ralf.gommers@gmail.com>
Sun, 3 Jul 2022 11:12:56 +0000 (13:12 +0200)
committerJochen Sprickerhof <jspricke@debian.org>
Tue, 3 Jan 2023 20:59:59 +0000 (20:59 +0000)
The reason is a divide-by-zero warning that our test suite settings
convert to an error. So ignore these warnings, because they're
coming from inside `scikit-umfpack`.

This has been failing consistently in the Azure pre-release job.

Closes gh-16523

[skip github]

Gbp-Pq: Name 0017-MAINT-fix-umfpack-test-failure-with-numpy-1.23.patch

scipy/sparse/linalg/_dsolve/linsolve.py

index 35e6ba5fbc4d2b9027f2bf8f57d6d514879e5796..4a126d036994deec9d13f70fb4bdd0e54325c7ea 100644 (file)
@@ -485,7 +485,11 @@ def factorized(A):
         umf.numeric(A)
 
         def solve(b):
-            return umf.solve(umfpack.UMFPACK_A, A, b, autoTranspose=True)
+            with np.errstate(divide="ignore", invalid="ignore"):
+                # Ignoring warnings with numpy >= 1.23.0, see gh-16523
+                result = umf.solve(umfpack.UMFPACK_A, A, b, autoTranspose=True)
+
+            return result
 
         return solve
     else: