Ignore:
Timestamp:
Sep 8, 2018 9:32:23 AM (6 years ago)
Author:
GitHub <noreply@…>
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:
35e36fd, c0de493
Parents:
3090270 (diff), 01b4877 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Torin Cooper-Bennun <40573959+tcbennun@…> (09/08/18 09:32:23)
git-committer:
GitHub <noreply@…> (09/08/18 09:32:23)
Message:

Merge pull request #174 from SasView?/ESS_GUI_iss1034

SASVIEW-1034: Support for parameters injected into the product model by sasmodels

File:
1 edited

Legend:

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

    r3090270 rc8536d6c  
    21022102            return 
    21032103 
     2104        product_params = None 
     2105 
    21042106        if self.kernel_module is None: 
    21052107            # Structure factor is the only selected model; build it and show all its params 
     
    21072109            s_params = self.kernel_module._model_info.parameters 
    21082110            s_params_orig = s_params 
    2109  
    21102111        else: 
    21112112            s_kernel = self.models[structure_factor]() 
     
    21242125            if "radius_effective_mode" in all_param_names: 
    21252126                # Show all parameters 
     2127                # In this case, radius_effective is NOT pruned by sasmodels.product 
    21262128                s_params = modelinfo.ParameterTable(all_params[p_pars_len:p_pars_len+s_pars_len]) 
    21272129                s_params_orig = modelinfo.ParameterTable(s_kernel._model_info.parameters.kernel_parameters) 
     2130                product_params = modelinfo.ParameterTable( 
     2131                        self.kernel_module._model_info.parameters.kernel_parameters[p_pars_len+s_pars_len:]) 
    21282132            else: 
    21292133                # Ensure radius_effective is not displayed 
    21302134                s_params_orig = modelinfo.ParameterTable(s_kernel._model_info.parameters.kernel_parameters[1:]) 
    21312135                if "radius_effective" in all_param_names: 
     2136                    # In this case, radius_effective is NOT pruned by sasmodels.product 
    21322137                    s_params = modelinfo.ParameterTable(all_params[p_pars_len+1:p_pars_len+s_pars_len]) 
     2138                    product_params = modelinfo.ParameterTable( 
     2139                            self.kernel_module._model_info.parameters.kernel_parameters[p_pars_len+s_pars_len:]) 
    21332140                else: 
     2141                    # In this case, radius_effective is pruned by sasmodels.product 
    21342142                    s_params = modelinfo.ParameterTable(all_params[p_pars_len:p_pars_len+s_pars_len-1]) 
     2143                    product_params = modelinfo.ParameterTable( 
     2144                            self.kernel_module._model_info.parameters.kernel_parameters[p_pars_len+s_pars_len-1:]) 
    21352145 
    21362146        # Add heading row 
     
    21402150        # Any renamed parameters are stored as data in the relevant item, for later handling 
    21412151        FittingUtilities.addSimpleParametersToModel( 
    2142                 s_params, 
    2143                 self.is2D, 
    2144                 s_params_orig, 
    2145                 self._model_model, 
    2146                 self.lstParams) 
     2152                parameters=s_params, 
     2153                is2D=self.is2D, 
     2154                parameters_original=s_params_orig, 
     2155                model=self._model_model, 
     2156                view=self.lstParams) 
     2157 
     2158        # Insert product-only params into QModel 
     2159        if product_params: 
     2160            prod_rows = FittingUtilities.addSimpleParametersToModel( 
     2161                    parameters=product_params, 
     2162                    is2D=self.is2D, 
     2163                    parameters_original=None, 
     2164                    model=self._model_model, 
     2165                    view=self.lstParams, 
     2166                    row_num=2) 
     2167 
     2168            # Since this all happens after shells are dealt with and we've inserted rows, fix this counter 
     2169            self._n_shells_row += len(prod_rows) 
    21472170 
    21482171    def haveParamsToFit(self): 
Note: See TracChangeset for help on using the changeset viewer.