From a213d2559a9070daefc826705b47ea4de6b6523a Mon Sep 17 00:00:00 2001 From: Bas Nijholt <basnijholt@gmail.com> Date: Wed, 10 Jan 2018 12:42:44 +0100 Subject: [PATCH] call np.linalg.lstsq with rcond=-1 to suppress the FutureWarning in numpy 1.14 Closes #182 --- kwant/linalg/lll.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kwant/linalg/lll.py b/kwant/linalg/lll.py index d01e7a0a..029dc8fa 100644 --- a/kwant/linalg/lll.py +++ b/kwant/linalg/lll.py @@ -100,7 +100,8 @@ def lll(basis, c=1.34): if abs(u[i+1, i]) > 0.5: ll_reduce(i+1) i = max(i-1, 0) - coefs = np.linalg.lstsq(vecs_orig.T, vecs.T)[0] + # TODO: change to rcond=None once we depend on numpy >= 1.14. + coefs = np.linalg.lstsq(vecs_orig.T, vecs.T, rcond=-1)[0] if not np.allclose(np.round(coefs), coefs, atol=1e-6): raise RuntimeError('LLL algorithm instability.') if not is_c_reduced(vecs, c): -- GitLab