Changeset 3e6829d in sasview


Ignore:
Timestamp:
Oct 22, 2018 5:49:40 PM (3 weeks ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, config-error, simplify-c-build, ticket-1015-quick-fix, ticket-1212-bug-fix
Children:
57e48ca
Parents:
7ba6470
Message:

default to floating point division in pr

Location:
src/sas/sascalc/pr
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/pr/fit/BumpsFitting.py

    r9a5097c r3e6829d  
    22BumpsFitting module runs the bumps optimizer. 
    33""" 
     4from __future__ import division 
     5 
    46import os 
    57from datetime import timedelta, datetime 
     
    3436class Progress(object): 
    3537    def __init__(self, history, max_step, pars, dof): 
    36         remaining_time = int(history.time[0]*(float(max_step)/history.step[0]-1)) 
     38        remaining_time = int(history.time[0]*(max_step/history.step[0]-1)) 
    3739        # Depending on the time remaining, either display the expected 
    3840        # time of completion, or the amount of time remaining.  Use precision 
  • src/sas/sascalc/pr/invertor.py

    r952ea1f r3e6829d  
    66FIXME: The way the Invertor interacts with its C component should be cleaned up 
    77""" 
     8from __future__ import division 
    89 
    910import numpy as np 
     
    496497        try: 
    497498            cov = np.linalg.pinv(inv_cov) 
    498             err = math.fabs(chi2 / float(npts - nfunc)) * cov 
     499            err = math.fabs(chi2 / (npts - nfunc)) * cov 
    499500        except Exception as exc: 
    500501            # We were not able to estimate the errors 
  • src/sas/sascalc/pr/num_term.py

    r2469df7 r3e6829d  
    1 from __future__ import print_function 
     1from __future__ import print_function, division 
    22 
    33import math 
     
    5151        osc = self.sort_osc() 
    5252        dv = len(osc) 
    53         med = float(dv) / 2.0 
     53        med = 0.5*dv 
    5454        odd = self.is_odd(dv) 
    5555        medi = 0 
     
    140140            nts = self.compare_err() 
    141141            div = len(nts) 
    142             tem = float(div) / 2.0 
     142            tem = 0.5*div 
    143143            if self.is_odd(div): 
    144144                nt = nts[int(tem)] 
Note: See TracChangeset for help on using the changeset viewer.