diff --git a/src/sas/sascalc/corfunc/corfunc_calculator.py b/src/sas/sascalc/corfunc/corfunc_calculator.py index b481cf43f8..108c2a59db 100644 --- a/src/sas/sascalc/corfunc/corfunc_calculator.py +++ b/src/sas/sascalc/corfunc/corfunc_calculator.py @@ -244,7 +244,9 @@ def _porod(self, q, K, sigma, bg): def _fit_guinier(self, q, iq): """Fit the Guinier region of the curve""" A = np.vstack([q**2, np.ones(q.shape)]).T - return lstsq(A, np.log(iq), rcond=None) + # CRUFT: numpy>=1.14.0 allows rcond=None for the following default + rcond = np.finfo(float).eps * max(A.shape) + return lstsq(A, np.log(iq), rcond=rcond) def _fit_porod(self, q, iq): """Fit the Porod region of the curve""" diff --git a/src/sas/sascalc/invariant/invariant.py b/src/sas/sascalc/invariant/invariant.py index 2237db51ac..5d65c685d0 100644 --- a/src/sas/sascalc/invariant/invariant.py +++ b/src/sas/sascalc/invariant/invariant.py @@ -343,8 +343,10 @@ def fit(self, power=None, qmin=None, qmax=None): return [a, b], [0, math.sqrt(err)] else: A = np.vstack([linearized_data.x / linearized_data.dy, 1.0 / linearized_data.dy]).T + # CRUFT: numpy>=1.14.0 allows rcond=None for the following default + rcond = np.finfo(float).eps * max(A.shape) p, residuals, _, _ = np.linalg.lstsq(A, linearized_data.y / linearized_data.dy, - rcond=None) + rcond=rcond) # Get the covariance matrix, defined as inv_cov = a_transposed * a err = np.zeros(2) diff --git a/src/sas/sascalc/pr/invertor.py b/src/sas/sascalc/pr/invertor.py index 07afd4a564..6cc56b7ac5 100644 --- a/src/sas/sascalc/pr/invertor.py +++ b/src/sas/sascalc/pr/invertor.py @@ -473,7 +473,9 @@ def lstsq(self, nfunc=5, nr=20): raise RuntimeError("Invertor: could not invert I(Q)\n %s" % str(exc)) # Perform the inversion (least square fit) - c, chi2, _, _ = lstsq(a, b, rcond=-1) + # CRUFT: numpy>=1.14.0 allows rcond=None for the following default + rcond = np.finfo(float).eps * max(a.shape) + c, chi2, _, _ = lstsq(a, b, rcond=rcond) # Sanity check try: float(chi2)