Changeset 65f3930 in sasview for src/sas/sascalc/fit/models.py
- Timestamp:
- Jun 26, 2017 4:22:56 PM (7 years ago)
- 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, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 50fcb09
- Parents:
- 98e3f24
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/fit/models.py
rba8d326 r65f3930 14 14 import py_compile 15 15 import shutil 16 17 from sasmodels.sasview_model import load_custom_model, load_standard_models 18 16 19 # Explicitly import from the pluginmodel module so that py2exe 17 20 # places it in the distribution. The Model1DPlugin class is used 18 21 # as the base class of plug-in models. 19 from sas.sascalc.fit.pluginmodel import Model1DPlugin 22 from .pluginmodel import Model1DPlugin 23 20 24 from sas.sasgui.guiframe.CategoryInstaller import CategoryInstaller 21 from sasmodels.sasview_model import load_custom_model, load_standard_models22 25 23 26 logger = logging.getLogger(__name__) … … 28 31 "plugins.log") 29 32 PLUGIN_NAME_BASE = '[plug-in] ' 30 31 def get_model_python_path():32 """33 Returns the python path for a model34 """35 return os.path.dirname(__file__)36 33 37 34 … … 418 415 implement model 419 416 """ 420 __modelmanager = ModelManagerBase() 421 cat_model_list = [__modelmanager.model_dictionary[model_name] for model_name \ 422 in __modelmanager.model_dictionary.keys() \ 423 if model_name not in __modelmanager.stored_plugins.keys()] 424 425 CategoryInstaller.check_install(model_list=cat_model_list) 417 base = None # type: ModelManagerBase() 418 419 def __init__(self): 420 if ModelManager.base is None: 421 self.base = ModelManagerBase() 422 423 def cat_model_list(self): 424 models = self.base.model_dictionary 425 retval = [model for model_name, model in models.items() 426 if model_name not in self.base.stored_plugins] 427 return retval 428 426 429 def findModels(self): 427 return self. __modelmanager.findModels()430 return self.base.findModels() 428 431 429 432 def _getModelList(self): 430 return self. __modelmanager._getModelList()433 return self.base._getModelList() 431 434 432 435 def is_changed(self): 433 return self. __modelmanager.is_changed()436 return self.base.is_changed() 434 437 435 438 def update(self): 436 return self. __modelmanager.update()439 return self.base.update() 437 440 438 441 def plugins_reset(self): 439 return self. __modelmanager.plugins_reset()440 441 def populate_menu(self, modelmenu, event_owner):442 return self.__modelmanager.populate_menu(modelmenu, event_owner)442 return self.base.plugins_reset() 443 444 #def populate_menu(self, modelmenu, event_owner): 445 # return self.base.populate_menu(modelmenu, event_owner) 443 446 444 447 def _on_model(self, evt): 445 return self. __modelmanager._on_model(evt)448 return self.base._on_model(evt) 446 449 447 450 def _get_multifunc_models(self): 448 return self. __modelmanager._get_multifunc_models()451 return self.base._get_multifunc_models() 449 452 450 453 def get_model_list(self): 451 return self. __modelmanager.get_model_list()454 return self.base.get_model_list() 452 455 453 456 def get_model_name_list(self): 454 return self. __modelmanager.get_model_name_list()457 return self.base.get_model_name_list() 455 458 456 459 def get_model_dictionary(self): 457 return self. __modelmanager.get_model_dictionary()460 return self.base.get_model_dictionary()
Note: See TracChangeset
for help on using the changeset viewer.