Changeset ab3ed7e in sasview


Ignore:
Timestamp:
Mar 20, 2016 5:56:49 AM (9 years ago)
Author:
gonzalezm
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:
105ef92
Parents:
76d905f
Message:

Discover and use python and python+C models added to the user plugin_models folder

Location:
src/sas/sasgui/perspectives/fitting
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/basepage.py

    rbac3988 rab3ed7e  
    18951895            if mod_cat == custom_model: 
    18961896                for model in self.model_list_box[mod_cat]: 
    1897                     str_m = str(model).split(".")[0] 
     1897                    if 'sasmodels.sasview_model.' in str(model): 
     1898                        str_m = model._model_info['id'] 
     1899                    else: 
     1900                        str_m = str(model).split(".")[0] 
    18981901                    #self.model_box.Append(str_m) 
    18991902                    m_list.append(self.model_dict[str_m]) 
  • src/sas/sasgui/perspectives/fitting/models.py

    ra0b355b rab3ed7e  
    181181            if toks[1] == '.py' and not toks[0] == '__init__': 
    182182                name = toks[0] 
    183  
    184183                path = [os.path.abspath(dir)] 
    185184                file = None 
     
    197196                                                         sys.exc_info()[1]) 
    198197                            log(msg) 
     198                    else: 
     199                        filename = os.path.join(dir, item) 
     200                        plugins[name] = sasview_model.make_class_from_file(filename)  
     201 
    199202                except: 
    200203                    msg = "Error accessing Model" 
     
    211214        msg = "Could not import model plugin: %s" % sys.exc_info()[1] 
    212215        log(msg) 
     216 
    213217    return plugins 
    214218 
     
    311315                self.multiplication_factor.append(model) 
    312316 
    313  
    314317        #Looking for plugins 
    315318        self.stored_plugins = self.findModels() 
     
    317320        for name, plug in self.stored_plugins.iteritems(): 
    318321            self.model_dictionary[name] = plug 
    319  
     322         
    320323        self._get_multifunc_models() 
    321324 
Note: See TracChangeset for help on using the changeset viewer.