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/fit_thread.py

    r386ffe1 r2f4b430  
    99    Execute class.function and return result 
    1010    """ 
    11     return  getattr(classInstance,classFunc)(*args) 
     11    return  getattr(classInstance, classFunc)(*args) 
    1212 
    1313def map_apply(arguments): 
     
    1616class FitThread(CalcThread): 
    1717    """Thread performing the fit """ 
    18      
    19     def __init__(self,  
     18 
     19    def __init__(self, 
    2020                 fn, 
    2121                 page_id, 
     
    2424                 batch_inputs=None, 
    2525                 pars=None, 
    26                  completefn = None, 
    27                  updatefn   = None, 
    28                  yieldtime  = 0.03, 
    29                  worktime   = 0.03, 
    30                  reset_flag = False): 
     26                 completefn=None, 
     27                 updatefn=None, 
     28                 yieldtime=0.03, 
     29                 worktime=0.03, 
     30                 reset_flag=False): 
    3131        CalcThread.__init__(self, 
    3232                 completefn, 
     
    4444        #Relative error desired in the sum of squares. 
    4545        self.reset_flag = reset_flag 
    46     
     46 
    4747    def isquit(self): 
    4848        """ 
    4949        :raise KeyboardInterrupt: when the thread is interrupted 
    50          
     50 
    5151        """ 
    5252        try: 
     
    5555            msg = "Fitting: terminated by the user." 
    5656            raise KeyboardInterrupt, msg 
    57         
     57 
    5858    def compute(self): 
    5959        """ 
    60         Perform a fit  
     60        Perform a fit 
    6161        """ 
    6262        msg = "" 
     
    6464            import copy 
    6565            list_handler = [] 
    66             list_curr_thread = []  
     66            list_curr_thread = [] 
    6767            list_reset_flag = [] 
    6868            list_map_get_attr = [] 
     
    7878            #from multiprocessing import Pool 
    7979            inputs = zip(list_map_get_attr, self.fitter, list_fit_function, 
    80                          list_q, list_q, list_handler,list_curr_thread, 
     80                         list_q, list_q, list_handler, list_curr_thread, 
    8181                         list_reset_flag) 
    82             result =  map(map_apply, inputs) 
    83      
     82            result = map(map_apply, inputs) 
     83 
    8484            self.complete(result=result, 
    8585                          batch_inputs=self.batch_inputs, 
    8686                          batch_outputs=self.batch_outputs, 
    8787                          page_id=self.page_id, 
    88                           pars = self.pars, 
    89                           elapsed=time.time()-self.starttime) 
    90             
     88                          pars=self.pars, 
     89                          elapsed=time.time() - self.starttime) 
     90 
    9191        except KeyboardInterrupt, msg: 
    9292            # Thread was interrupted, just proceed and re-raise. 
     
    9595            #Stop on exception during fitting. Todo: need to put  
    9696            #some mssg and reset progress bar. 
    97              
     97 
    9898            if self.handler is not None: 
    9999                self.handler.stop(msg=msg) 
     
    102102            if self.handler is not None: 
    103103                self.handler.error(msg=traceback.format_exc()) 
    104             
    105          
    106      
     104 
     105 
     106 
Note: See TracChangeset for help on using the changeset viewer.