Changeset 6b3edc1 in sasview


Ignore:
Timestamp:
Oct 12, 2011 3:56:03 PM (13 years ago)
Author:
Jae Cho <jhjcho@…>
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:
e8f7c47
Parents:
ea8283d
Message:

fixing error when theory=None

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fittingview/src/sans/perspectives/fitting/fitting.py

    r4a52223 r6b3edc1  
    12171217            batch_outputs["Data"] = [] 
    12181218        from sans.guiframe.data_processor import BatchCell 
    1219         cell = BatchCell() 
    1220         cell.label = data.name 
    1221         cell.value = index 
    1222         theory_data.id = wx.NewId() 
    1223         theory_data.name = model.name + "[%s]" % str(model.__class__.__name__) 
    1224         cell.object = [data, theory_data] 
    1225         batch_outputs["Data"].append(cell) 
    1226         for key, value in data.meta_data.iteritems(): 
    1227             if key not in batch_inputs.keys(): 
    1228                 batch_inputs[key] = [] 
    1229             if key.lower().strip() != "loader": 
    1230                 batch_inputs[key].append(value) 
    1231         param = "temperature" 
    1232         if hasattr(data.sample, param): 
    1233             if param not in  batch_inputs.keys(): 
    1234                  batch_inputs[param] = [] 
    1235             batch_inputs[param].append(data.sample.temperature) 
    1236         # associate residuals plot 
    1237         batch_outputs["Chi2"][index].object = [residuals] 
    1238         
    1239     
     1219         
     1220        try: 
     1221            #Suucessful fit 
     1222            cell = BatchCell() 
     1223            cell.label = data.name 
     1224            cell.value = index 
     1225            theory_data.id = wx.NewId() 
     1226            theory_data.name = model.name + "[%s]" % str(model.__class__.__name__) 
     1227            cell.object = [data, theory_data] 
     1228            batch_outputs["Data"].append(cell) 
     1229            for key, value in data.meta_data.iteritems(): 
     1230                if key not in batch_inputs.keys(): 
     1231                    batch_inputs[key] = [] 
     1232                if key.lower().strip() != "loader": 
     1233                    batch_inputs[key].append(value) 
     1234            param = "temperature" 
     1235            if hasattr(data.sample, param): 
     1236                if param not in  batch_inputs.keys(): 
     1237                     batch_inputs[param] = [] 
     1238                batch_inputs[param].append(data.sample.temperature) 
     1239            # associate residuals plot 
     1240            batch_outputs["Chi2"][index].object = [residuals] 
     1241        except:  
     1242            # theory is None 
     1243            pass 
     1244 
    12401245    def _fit_completed(self, result, page_id, batch_outputs, 
    12411246                             batch_inputs=None, 
Note: See TracChangeset for help on using the changeset viewer.