Changeset a0b355b in sasview for src/sas/sasgui/perspectives/fitting


Ignore:
Timestamp:
Mar 18, 2016 11:54:57 AM (9 years ago)
Author:
ajj
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:
6a9c0e5a
Parents:
6313823
Message:

Fixing polydispersity. Closes #533

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

Legend:

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

    rb609c34 ra0b355b  
    621621        model_disp = wx.StaticText(self, wx.ID_ANY, 'Function') 
    622622        CHECK_STATE = self.cb1.GetValue() 
    623         import sas.models.dispersion_models 
    624         self.polydisp = sas.models.dispersion_models.models 
     623        #import sas.models.dispersion_models 
     624        #self.polydisp = sas.models.dispersion_models.models 
     625        import sasmodels.weights 
     626        self.polydisp =  sasmodels.weights.models 
    625627 
    626628        ix = 0 
  • src/sas/sasgui/perspectives/fitting/models.py

    rcde9d7d ra0b355b  
    2020from sas.models.BaseComponent import BaseComponent 
    2121from sas.sasgui.guiframe.CategoryInstaller import CategoryInstaller 
    22 from sasmodels.sasview_model import make_class 
    23 import sasmodels.core 
     22from sasmodels import sasview_model,core 
    2423 
    2524 
     
    301300 
    302301        #Build list automagically from sasmodels package 
    303         for mod_name in sasmodels.core.list_models(): 
    304             try: 
    305                 mod_def = sasmodels.core.load_model_info(mod_name) 
    306                 self.model_dictionary[mod_def['name']] = make_class(mod_def,dtype=None,namestyle='name') 
    307                 if mod_def['structure_factor'] == True: 
    308                     self.struct_list.append(self.model_dictionary[mod_def['name']]) 
    309                 if mod_def['variant_info'] is not None: 
    310                     self.multi_func_list.append(self.model_dictionary[mod_def['name']]) 
    311                 else: 
    312                     self.model_name_list.append(mod_def['name']) 
    313                 if mod_def['ER'] is not None: 
    314                     self.multiplication_factor.append(self.model_dictionary[mod_def['name']]) 
    315             except: 
    316                 logging.info("Problem loading %s model" % mod_name) 
     302        for model in sasview_model.standard_models(): 
     303            self.model_dictionary[model._model_info['name']] = model 
     304            if model._model_info['structure_factor'] == True: 
     305                self.struct_list.append(model) 
     306            if model._model_info['variant_info'] is not None: 
     307                self.multi_func_list.append(model) 
     308            else: 
     309                self.model_name_list.append(model._model_info['name']) 
     310            if model._model_info['ER'] is not None: 
     311                self.multiplication_factor.append(model) 
     312 
    317313 
    318314        #Looking for plugins 
Note: See TracChangeset for help on using the changeset viewer.