Changeset e68bfef in sasview


Ignore:
Timestamp:
Oct 6, 2011 1:09:45 PM (13 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:
e03a14e
Parents:
5722d66
Message:

make sure all model parameters are displayed in the grid whether or not they were fitted

File:
1 edited

Legend:

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

    r90ddcdb re68bfef  
    3434from sans.guiframe.gui_style import GUIFRAME_ID 
    3535from sans.guiframe.plugin_base import PluginBase  
     36from sans.guiframe.data_processor import BatchCell 
    3637from sans.fit.Fitting import Fit 
    3738from .console import ConsoleUpdate 
     
    10641065                if res is None: 
    10651066                    null_value = numpy.nan 
    1066                     from sans.guiframe.data_processor import BatchCell 
    10671067                    cell = BatchCell() 
    10681068                    cell.label = null_value 
     
    10701070                    cell.object = [None] 
    10711071                    batch_outputs["Chi2"].append(cell) 
    1072                     for index  in range(len(pars)): 
    1073                         batch_outputs[pars[index]].append(null_value) 
    1074                         item = null_value 
    1075                         batch_inputs["error on %s" % pars[index]].append(item) 
    1076                         if pars[index] in model.getParamList(): 
    1077                             temp_model.setParam(pars[index], res.pvec[index]) 
     1072                    for param in temp_model.getParamList(): 
     1073                        if temp_model.is_fittable(param): 
     1074                            for index  in range(len(pars)): 
     1075                                #replug only fitted values 
     1076                                if param != pars[index]: 
     1077                                    batch_outputs[pars[index]].append(null_value) 
     1078                                    item = null_value 
     1079                                    batch_inputs["error on %s" % pars[index]].append(item) 
     1080                                    if pars[index] in model.getParamList(): 
     1081                                        temp_model.setParam(pars[index], res.pvec[index]) 
     1082                                else: 
     1083                                     batch_outputs[str(param)].append(temp_model.getParam(param)) 
    10781084                else: 
    10791085                    from sans.guiframe.data_processor import BatchCell 
     
    10821088                    cell.value = res.fitness 
    10831089                    batch_outputs["Chi2"].append(cell) 
    1084                     for index  in range(len(pars)): 
    1085                         batch_outputs[pars[index]].append(res.pvec[index]) 
    1086                         item = res.stderr[index] 
    1087                         batch_inputs["error on %s" % pars[index]].append(item) 
    1088                         if pars[index] in temp_model.getParamList(): 
    1089                             temp_model.setParam(pars[index], res.pvec[index]) 
    1090                          
     1090                    for param in temp_model.getParamList(): 
     1091                        if temp_model.is_fittable(param): 
     1092                            for index  in range(len(pars)): 
     1093                                #replug only fitted values 
     1094                                if param != pars[index]: 
     1095                                    batch_outputs[pars[index]].append(res.pvec[index]) 
     1096                                    item = res.stderr[index] 
     1097                                    batch_inputs["error on %s" % pars[index]].append(item) 
     1098                                    if pars[index] in temp_model.getParamList(): 
     1099                                        temp_model.setParam(pars[index], res.pvec[index]) 
     1100                                else: 
     1101                                     batch_outputs[str(param)].append(temp_model.getParam(param)) 
     1102                                 
    10911103                self.page_finder[pid].set_batch_result(batch_inputs=batch_inputs, 
    10921104                                                 batch_outputs=batch_outputs)    
     
    11431155            if key not in batch_inputs.keys(): 
    11441156                batch_inputs[key] = [] 
    1145             batch_inputs[key].append(value) 
     1157            if key.lower().strip() != "loader": 
     1158                batch_inputs[key].append(value) 
    11461159        param = "temperature" 
    11471160        if hasattr(data.sample, param): 
Note: See TracChangeset for help on using the changeset viewer.