From ad4d3061e3cd3ec4163c8b94a86608b0ec54fa7a Mon Sep 17 00:00:00 2001 From: Michael Ekstrand Date: Thu, 28 Jul 2022 18:09:17 -0600 Subject: [PATCH 1/2] Add Numba 0.56 to support matrix (#319) --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d9bc6e17c..cea455ab5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ dependencies = [ "pandas >=1.0, ==1.*", "numpy >= 1.17", "scipy >= 1.2", - "numba >= 0.51, < 0.56", + "numba >= 0.51, < 0.57", "cffi >= 1.12.2", "psutil >= 5", "binpickle >= 0.3.2", From adf1a7fbff01d7ccde711f2412c15ef4c9bb161a Mon Sep 17 00:00:00 2001 From: Michael Ekstrand Date: Tue, 16 Aug 2022 13:36:00 -0600 Subject: [PATCH 2/2] Fix liveness problems in _dposv --- lenskit/math/solve.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lenskit/math/solve.py b/lenskit/math/solve.py index 8ad8f8068..dfbf966bd 100644 --- a/lenskit/math/solve.py +++ b/lenskit/math/solve.py @@ -42,8 +42,10 @@ def _dposv(A, b, lower): # invert the meaning of 'lower' and 'trans', and the function will work fine. # We also need to swap index orders uplo = __uplo_U if lower else __uplo_L - n_p = __ffi.from_buffer(np.array([A.shape[0]], dtype=np.intc)) - nrhs_p = __ffi.from_buffer(np.ones(1, dtype=np.intc)) + narr = np.array([A.shape[0]], dtype=np.intc) + n_p = __ffi.from_buffer(narr) + nrhs = np.ones(1, dtype=np.intc) + nrhs_p = __ffi.from_buffer(nrhs) info = np.zeros(1, dtype=np.intc) info_p = __ffi.from_buffer(info) @@ -52,7 +54,7 @@ def _dposv(A, b, lower): __ffi.from_buffer(b), n_p, info_p) - _ref_sink(n_p, nrhs_p, info, info_p) + _ref_sink(narr, n_p, nrhs, nrhs_p, info, info_p) return info[0]