From ff94a0f1e0897b5bbf001234cb8cf2eaa2498f8b Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Sun, 3 Jul 2022 13:12:56 +0200 Subject: [PATCH] MAINT: fix umfpack test failure with numpy 1.23 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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scipy/sparse/linalg/_dsolve/linsolve.py b/scipy/sparse/linalg/_dsolve/linsolve.py index 35e6ba5f..4a126d03 100644 --- a/scipy/sparse/linalg/_dsolve/linsolve.py +++ b/scipy/sparse/linalg/_dsolve/linsolve.py @@ -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: -- 2.30.2