Changeset dbfd307 in sasview for src


Ignore:
Timestamp:
Mar 5, 2019 4:21:09 PM (6 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1249
Children:
7af652d
Parents:
4cbb2f5
Message:

use np ≥ 1.14.0 default for lstsq rcond, but compatible with np < 1.14.0

Location:
src/sas/sascalc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/corfunc/corfunc_calculator.py

    re090ba90 rdbfd307  
    245245        """Fit the Guinier region of the curve""" 
    246246        A = np.vstack([q**2, np.ones(q.shape)]).T 
    247         return lstsq(A, np.log(iq), rcond=None) 
     247        # CRUFT: numpy>=1.14.0 allows rcond=None for the following default 
     248        rcond = np.finfo(float).eps * max(A.shape) 
     249        return lstsq(A, np.log(iq), rcond=rcond) 
    248250 
    249251    def _fit_porod(self, q, iq): 
  • src/sas/sascalc/invariant/invariant.py

    re090ba90 rdbfd307  
    344344        else: 
    345345            A = np.vstack([linearized_data.x / linearized_data.dy, 1.0 / linearized_data.dy]).T 
     346            # CRUFT: numpy>=1.14.0 allows rcond=None for the following default 
     347            rcond = np.finfo(float).eps * max(A.shape) 
    346348            p, residuals, _, _ = np.linalg.lstsq(A, linearized_data.y / linearized_data.dy, 
    347                                                  rcond=None) 
     349                                                 rcond=rcond) 
    348350 
    349351            # Get the covariance matrix, defined as inv_cov = a_transposed * a 
  • src/sas/sascalc/pr/invertor.py

    r2469df7 rdbfd307  
    473473 
    474474        # Perform the inversion (least square fit) 
    475         c, chi2, _, _ = lstsq(a, b) 
     475        # CRUFT: numpy>=1.14.0 allows rcond=None for the following default 
     476        rcond = np.finfo(float).eps * max(a.shape) 
     477        c, chi2, _, _ = lstsq(a, b, rcond=rcond) 
    476478        # Sanity check 
    477479        try: 
Note: See TracChangeset for help on using the changeset viewer.