Changeset 038c00cf in sasview for src/sas/pr/distance_explorer.py


Ignore:
Timestamp:
Mar 2, 2015 4:38:00 PM (9 years ago)
Author:
Doucet, Mathieu <doucetm@…>
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, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
f06d7fc
Parents:
13e46abe
Message:

more pylint clean up

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/pr/distance_explorer.py

    r79492222 r038c00cf  
    33#This software was developed by the University of Tennessee as part of the 
    44#Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 
    5 #project funded by the US National Science Foundation.  
     5#project funded by the US National Science Foundation. 
    66# 
    77#See the license text in license.txt 
     
    1919 
    2020 
    21 class Results: 
     21class Results(object): 
    2222    """ 
    2323    Class to hold the inversion output parameters 
     
    4040        ## List of errors found during the last exploration 
    4141        self.errors = [] 
    42          
    43          
     42 
     43 
    4444class DistExplorer(object): 
    4545    """ 
    4646    The explorer class 
    4747    """ 
    48      
     48 
    4949    def __init__(self, pr_state): 
    5050        """ 
    5151        Initialization. 
    52          
     52 
    5353        :param pr_state: sas.pr.invertor.Invertor object 
    54          
     54 
    5555        """ 
    5656        self.pr_state = pr_state 
    5757        self._default_min = 0.8 * self.pr_state.d_max 
    5858        self._default_max = 1.2 * self.pr_state.d_max 
    59          
     59 
    6060    def __call__(self, dmin=None, dmax=None, npts=10): 
    6161        """ 
    6262        Compute the outputs as a function of D_max. 
    63          
     63 
    6464        :param dmin: minimum value for D_max 
    6565        :param dmax: maximum value for D_max 
    6666        :param npts: number of points for D_max 
    67          
     67 
    6868        """ 
    6969        # Take care of the defaults if needed 
    7070        if dmin is None: 
    7171            dmin = self._default_min 
    72              
     72 
    7373        if dmax is None: 
    7474            dmax = self._default_max 
    75              
     75 
    7676        # Results object to store the computation outputs. 
    7777        results = Results() 
    78          
     78 
    7979        # Loop over d_max values 
    8080        for i in range(npts): 
     
    8383            try: 
    8484                out, cov = self.pr_state.invert(self.pr_state.nfunc) 
    85              
     85 
    8686                # Store results 
    8787                iq0 = self.pr_state.iq0(out) 
     
    9090                pos_err = self.pr_state.get_pos_err(out, cov) 
    9191                osc = self.pr_state.oscillations(out) 
    92              
     92 
    9393                results.d_max.append(self.pr_state.d_max) 
    9494                results.bck.append(self.pr_state.background) 
     
    104104                msg += "D_max=%s\n %s" % (str(d), sys.exc_value) 
    105105                results.errors.append(msg) 
    106              
     106 
    107107        return results 
Note: See TracChangeset for help on using the changeset viewer.