Changeset c7809a9 in sasview for src


Ignore:
Timestamp:
Sep 4, 2018 3:51:26 AM (6 years ago)
Author:
Torin Cooper-Bennun <torin.cooper-bennun@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
f3a19ad
Parents:
700b03b
git-author:
Torin Cooper-Bennun <torin.cooper-bennun@…> (08/30/18 09:25:34)
git-committer:
Torin Cooper-Bennun <torin.cooper-bennun@…> (09/04/18 03:51:26)
Message:

[CHERRY-PICK FROM 099369c03] fix mishaps when still using beta_approx / beta_approx_lazy_results branches of sasmodels

Location:
src/sas/qtgui/Perspectives/Fitting
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py

    r700b03b rc7809a9  
    160160        item4 = QtGui.QStandardItem(str(param.limits[0])) 
    161161        item5 = QtGui.QStandardItem(str(param.limits[1])) 
    162         item6 = QtGui.QStandardItem(param.units) 
     162        item6 = QtGui.QStandardItem(str(param.units)) 
    163163        item6.setEditable(False) 
    164164        item.append([item1, item2, item4, item5, item6]) 
  • src/sas/qtgui/Perspectives/Fitting/FittingWidget.py

    r700b03b rc7809a9  
    20682068 
    20692069        self.kernel_module = MultiplicationModel(p_kernel, s_kernel) 
     2070        all_params = self.kernel_module._model_info.parameters.kernel_parameters 
     2071        all_param_names = [param.name for param in all_params] 
    20702072 
    20712073        # S(Q) params from the product model are not necessarily the same as those from the S(Q) model; any conflicting 
    20722074        # names with P(Q) params will cause a rename; we also lose radius_effective (for now...) 
    2073         s_params = modelinfo.ParameterTable( 
    2074             self.kernel_module._model_info.parameters.kernel_parameters[p_pars_len:p_pars_len+s_pars_len]) 
    2075  
    2076         # These are the parameters before rename; ignore the first one, as it is radius_effective, which is removed 
    2077         # from the product model to be handled internally (for now...) 
    2078         s_params_orig = modelinfo.ParameterTable(s_kernel._model_info.parameters.kernel_parameters[1:]) 
     2075 
     2076        if "radius_effective_mode" in all_param_names: 
     2077            # for this version of sasmodels we do NOT kill radius_effective 
     2078            s_params = modelinfo.ParameterTable(all_params[p_pars_len:p_pars_len+s_pars_len]) 
     2079            s_params_orig = modelinfo.ParameterTable(s_kernel._model_info.parameters.kernel_parameters) 
     2080        else: 
     2081            # kill radius_effective 
     2082            s_pars_len -= 1 
     2083            s_params = modelinfo.ParameterTable(all_params[p_pars_len+1:p_pars_len+s_pars_len]) 
     2084            s_params_orig = modelinfo.ParameterTable(s_kernel._model_info.parameters.kernel_parameters[1:]) 
    20792085 
    20802086        # Get new rows for QModel 
     
    20822088        new_rows = FittingUtilities.addSimpleParametersToModel(s_params, self.is2D, s_params_orig) 
    20832089 
    2084         # TODO: deal with new parameter(s) added to product model, in kernel_parameters[p_pars_len+s_pars_len:] 
     2090        # TODO: merge the rest of this implementation in 
     2091        # These parameters are not part of P(Q) nor S(Q), but are added only to the product model (e.g. specifying 
     2092        # structure factor calculation mode) 
     2093        # product_params = all_params[p_pars_len+s_pars_len:] 
    20852094 
    20862095        # Add heading row 
     
    23442353            GuiUtils.deleteRedundantPlots(self.all_data[self.data_index], new_plots) 
    23452354 
     2355        # TODO: merge rest of beta approx implementation in 
     2356        # TODO: refactor 
     2357        # deal with constrained radius_effective 
     2358        # for row in range(self._model_model.rowCount()): 
     2359        #     if self._model_model.item(row, 0).text() == "radius_effective_mode": 
     2360        #         if GuiUtils.toDouble(self._model_model.item(row, 1).text()) == 0: 
     2361        #             return 
     2362        # radius_effective = intermediate_ER() 
     2363        # if radius_effective: 
     2364        #     for row in range(self._model_model.rowCount()): 
     2365        #         if self._model_model.item(row, 0).text() == "radius_effective": 
     2366        #             self._model_model.item(row, 1).setText(str(radius_effective)) 
     2367        #             break 
     2368 
    23462369        for plot in new_plots: 
    23472370            if hasattr(plot, "id") and "esidual" in plot.id: 
Note: See TracChangeset for help on using the changeset viewer.