Changeset b1f20d1 in sasview for src/sas/sascalc/invariant


Ignore:
Timestamp:
Sep 14, 2017 10:38:14 AM (7 years ago)
Author:
krzywon
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
c54c965
Parents:
cd57c7d4
Message:

Make invariant calculator numpy 1.12+ compatible. refs #888

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/invariant/invariant.py

    r7432acb rb1f20d1  
    610610        # Data boundaries for fitting 
    611611        qmin = self._data.x[0] 
    612         qmax = self._data.x[self._low_extrapolation_npts - 1] 
     612        qmax = self._data.x[int(self._low_extrapolation_npts - 1)] 
    613613 
    614614        # Extrapolate the low-Q data 
     
    649649        # Data boundaries for fitting 
    650650        x_len = len(self._data.x) - 1 
    651         qmin = self._data.x[x_len - (self._high_extrapolation_npts - 1)] 
    652         qmax = self._data.x[x_len] 
     651        qmin = self._data.x[int(x_len - (self._high_extrapolation_npts - 1))] 
     652        qmax = self._data.x[int(x_len)] 
    653653 
    654654        # fit the data with a model to get the appropriate parameters 
     
    688688        if npts_in is None: 
    689689            npts_in = self._low_extrapolation_npts 
    690         q_end = self._data.x[max(0, npts_in - 1)] 
     690        q_end = self._data.x[max(0, int(npts_in - 1))] 
    691691 
    692692        if q_start >= q_end: 
     
    714714        # Get extrapolation range 
    715715        if npts_in is None: 
    716             npts_in = self._high_extrapolation_npts 
     716            npts_in = int(self._high_extrapolation_npts) 
    717717        _npts = len(self._data.x) 
    718         q_start = self._data.x[min(_npts, _npts - npts_in)] 
     718        q_start = self._data.x[min(_npts, int(_npts - npts_in))] 
    719719 
    720720        if q_start >= q_end: 
Note: See TracChangeset for help on using the changeset viewer.