Changeset dc71408 in sasview


Ignore:
Timestamp:
Jul 26, 2018 7:18:06 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:
7dd309a
Parents:
144fe21
Message:

fix sum/multiply models in fitpage (SASVIEW-972)

File:
1 edited

Legend:

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

    re4335ae rdc71408  
    5959 
    6060DEFAULT_POLYDISP_FUNCTION = 'gaussian' 
     61 
     62 
     63logger = logging.getLogger(__name__) 
    6164 
    6265 
     
    19141917            name = os.path.join(ModelUtilities.find_plugins_dir(), model_name+".py") 
    19151918        kernel_module = generate.load_kernel_module(name) 
    1916         self.model_parameters = modelinfo.make_parameter_table(getattr(kernel_module, 'parameters', [])) 
     1919 
     1920        if hasattr(kernel_module, 'parameters'): 
     1921            # built-in and custom models 
     1922            self.model_parameters = modelinfo.make_parameter_table(getattr(kernel_module, 'parameters', [])) 
     1923 
     1924        elif hasattr(kernel_module, 'model_info'): 
     1925            # for sum/multiply models 
     1926            self.model_parameters = kernel_module.model_info.parameters 
     1927 
     1928        elif hasattr(kernel_module, 'Model') and hasattr(kernel_module.Model, "_model_info"): 
     1929            # this probably won't work if there's no model_info, but just in case 
     1930            self.model_parameters = kernel_module.Model._model_info.parameters 
     1931        else: 
     1932            # no parameters - default to blank table 
     1933            msg = "No parameters found in model '{}'.".format(model_name) 
     1934            logger.warning(msg) 
     1935            self.model_parameters = modelinfo.ParameterTable([]) 
    19171936 
    19181937        # Instantiate the current sasmodel 
Note: See TracChangeset for help on using the changeset viewer.