Changeset 464fce54 in sasview for sansview/perspectives/fitting


Ignore:
Timestamp:
Nov 16, 2009 12:52:30 PM (15 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
255306e
Parents:
fd6b789
Message:

change fiting tu use the new set_model function declaration

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansview/perspectives/fitting/fitting.py

    rc69b6d5 r464fce54  
    472472                wx.PostEvent(self.parent, StatusEvent(status= msg )) 
    473473                return  
     474             
    474475        #Do the simultaneous fit 
    475476        try: 
     
    508509            wx.PostEvent(self.parent, StatusEvent(status= msg ,type="stop")) 
    509510            return  
     511         
     512         
    510513    def ready_fit(self): 
    511514        """ 
     
    608611        #Create list of parameters for fitting used 
    609612        templist=[] 
    610         pars=pars 
     613        
    611614        try: 
    612             ## create a park model and reset parameter value if constraint 
    613             ## is given 
    614             new_model = Model(model) 
     615            #Extra list of parameters and their constraints 
     616            listOfConstraint= [] 
     617             
    615618            param = value.get_model_param() 
    616619            if len(param)>0: 
    617620                for item in param: 
    618                     param_value = item[1] 
    619                     param_name = item[0] 
    620621                    ## check if constraint 
    621                     if param_value !=None and param_name != None: 
    622                         new_model.parameterset[ param_name].set( param_value ) 
    623              
     622                    if item[0] !=None and item[1] != None: 
     623                        listOfConstraint.append((item[0],item[1])) 
     624                    
    624625            #Do the single fit 
    625             self.fitter.set_model(new_model, self.fit_id, pars) 
     626            self.fitter.set_model(model, self.fit_id, 
     627                                   pars,constraints = listOfConstraint) 
    626628             
    627629            self.fitter.set_data(data=metadata,Uid=self.fit_id, 
     
    634636            msg= title +" error: %s" % sys.exc_value 
    635637            wx.PostEvent(self.parent, StatusEvent(status= msg, type="stop")) 
    636             return 
     638            
    637639        
    638640    def _onSelect(self,event): 
Note: See TracChangeset for help on using the changeset viewer.