From: Ralf Gommers Date: Sun, 3 Jul 2022 11:12:56 +0000 (+0200) Subject: MAINT: fix umfpack test failure with numpy 1.23 X-Git-Tag: archive/raspbian/1.8.1-21+rpi1^2~5 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ff94a0f1e0897b5bbf001234cb8cf2eaa2498f8b;p=scipy.git 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 --- 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: