Ignore:
Timestamp:
Mar 4, 2015 3:39:45 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:
74f419d
Parents:
2f732b0
Message:

Take care of white spaces (pylint)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/perspectives/fitting/model_thread.py

    r79492222 r2f4b430  
    4343        self.update_chisqr = update_chisqr 
    4444        self.source = source 
    45          
     45 
    4646    def compute(self): 
    4747        """ 
     
    5959                                   math.fabs(self.data.ymin)), 2) 
    6060                self.qmax = math.sqrt(newx + newy) 
    61          
     61 
    6262        if self.data is None: 
    6363            msg = "Compute Calc2D receive data = %s.\n" % str(self.data) 
    6464            raise ValueError, msg 
    65              
     65 
    6666        # Define matrix where data will be plotted 
    6767        radius = numpy.sqrt((self.data.qx_data * self.data.qx_data) + \ 
     
    7373        index_model = index_model & self.data.mask 
    7474        index_model = index_model & numpy.isfinite(self.data.data) 
    75        
     75 
    7676        if self.smearer is not None: 
    7777            # Set smearer w/ data, model and index. 
     
    112112                       update_chisqr=self.update_chisqr, 
    113113                       source=self.source) 
    114          
     114 
    115115 
    116116class Calc1D(CalcThread): 
     
    156156        self.out = None 
    157157        self.index = None 
    158          
     158 
    159159    def compute(self): 
    160160        """ 
     
    164164        output = numpy.zeros((len(self.data.x))) 
    165165        index = (self.qmin <= self.data.x) & (self.data.x <= self.qmax) 
    166       
     166 
    167167        ##smearer the ouput of the plot 
    168168        if self.smearer is not None: 
     
    174174        else: 
    175175            output[index] = self.model.evalDistribution(self.data.x[index]) 
    176           
     176 
    177177        elapsed = time.time() - self.starttime 
    178         
     178 
    179179        self.complete(x=self.data.x[index], y=output[index], 
    180180                      page_id=self.page_id, 
     
    187187                      update_chisqr=self.update_chisqr, 
    188188                      source=self.source) 
    189          
     189 
    190190    def results(self): 
    191191        """ 
     
    196196""" 
    197197Example: :: 
    198                       
     198 
    199199    class CalcCommandline: 
    200200        def __init__(self, n=20000): 
    201201            #print thread.get_ident() 
    202202            from sas.models.CylinderModel import CylinderModel 
    203              
     203 
    204204            model = CylinderModel() 
    205              
    206               
     205 
     206 
    207207            print model.runXY([0.01, 0.02]) 
    208              
     208 
    209209            qmax = 0.01 
    210210            qstep = 0.0001 
    211211            self.done = False 
    212              
     212 
    213213            x = numpy.arange(-qmax, qmax+qstep*0.01, qstep) 
    214214            y = numpy.arange(-qmax, qmax+qstep*0.01, qstep) 
    215          
    216          
     215 
     216 
    217217            calc_thread_2D = Calc2D(x, y, None, model.clone(),None, 
    218218                                    -qmax, qmax,qstep, 
     
    220220                                            updatefn=self.update , 
    221221                                            yieldtime=0.0) 
    222           
     222 
    223223            calc_thread_2D.queue() 
    224224            calc_thread_2D.ready(2.5) 
    225              
     225 
    226226            while not self.done: 
    227227                time.sleep(1) 
    228      
     228 
    229229        def update(self,output): 
    230230            print "update" 
    231      
     231 
    232232        def complete(self, image, data, model, elapsed, qmin, qmax,index, qstep ): 
    233233            print "complete" 
    234234            self.done = True 
    235      
     235 
    236236    if __name__ == "__main__": 
    237237        CalcCommandline() 
Note: See TracChangeset for help on using the changeset viewer.