Changes in / [02098e3:1c2bf90] in sasview
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
.gitignore
rf0d720b rbc873053 13 13 .pydevproject 14 14 .vagrant 15 .idea16 build17 dist18 sasview.egg-info19 sasview.egg-info20 21 15 .mplconfig 22 doctrees23 html24 build25 16 26 17 /setup.cfg 27 18 28 19 /dist 29 **/build20 /build 30 21 sasview.egg-info 31 22 sasview-install … … 50 41 /test/sasdataloader/test/plugins.zip 51 42 /test/sasdataloader/test/test_log.txt 52 -
run.py
rf9393dc rf9393dc 104 104 addpath(joinpath(root, 'src')) 105 105 106 # sasmodels on the path107 addpath(joinpath(root, '../sasmodels/'))108 109 106 # Import the sasview package from root/sasview as sas.sasview. It would 110 107 # be better to just store the package in src/sas/sasview. -
setup.py
r038ccfe6 r038ccfe6 244 244 model_dir = os.path.join("src", "sas","models") 245 245 246 #if os.path.isdir(wrapper_dir):247 # for file in os.listdir(wrapper_dir): 248 #file_path = os.path.join(wrapper_dir, file)249 #os.remove(file_path)250 #else:251 #os.makedirs(wrapper_dir)252 #sys.path.append(os.path.join("src", "sas", "models", "c_extension", "python_wrapper"))253 #from wrapping import generate_wrappers254 #generate_wrappers(header_dir = includedir, 255 #output_dir = model_dir,256 #c_wrapper_dir = wrapper_dir)246 if os.path.isdir(wrapper_dir): 247 for file in os.listdir(wrapper_dir): 248 file_path = os.path.join(wrapper_dir, file) 249 os.remove(file_path) 250 else: 251 os.makedirs(wrapper_dir) 252 sys.path.append(os.path.join("src", "sas", "models", "c_extension", "python_wrapper")) 253 from wrapping import generate_wrappers 254 generate_wrappers(header_dir = includedir, 255 output_dir = model_dir, 256 c_wrapper_dir = wrapper_dir) 257 257 258 258 IGNORED_FILES = [".svn"] … … 283 283 model_sources = [] 284 284 append_file(file_list=model_sources, dir_path=igordir) 285 #append_file(file_list=model_sources, dir_path=c_model_dir)286 #append_file(file_list=model_sources, dir_path=wrapper_dir)285 append_file(file_list=model_sources, dir_path=c_model_dir) 286 append_file(file_list=model_sources, dir_path=wrapper_dir) 287 287 288 288 smear_sources = [] … … 303 303 304 304 c_models = [ 305 #Extension("sas.models.sas_extension.c_models",306 # sources=model_sources,307 #include_dirs=[308 #igordir, includedir, c_model_dir, numpy_incl_path, cephes_dir309 #],310 #),305 Extension("sas.models.sas_extension.c_models", 306 sources=model_sources, 307 include_dirs=[ 308 igordir, includedir, c_model_dir, numpy_incl_path, cephes_dir 309 ], 310 ), 311 311 312 312 # Smearer extension … … 340 340 ext_modules.extend(c_models) 341 341 342 packages.append("sas.models")343 342 # SasView 344 343 … … 351 350 'test/save_states/*', 352 351 'test/upcoming_formats/*', 353 352 'default_categories.json'] 354 353 packages.append("sas.sasview") 355 354 -
src/sas/models/dispersion_models.py
r0e4e554 rfd5ac0d 154 154 c_models.set_dispersion_weights(self.cdisp, values, weights) 155 155 156 models = {"gaussian":GaussianDispersion, "rectangula r":RectangleDispersion,156 models = {"gaussian":GaussianDispersion, "rectangula":RectangleDispersion, 157 157 "array":ArrayDispersion, "schulz":SchulzDispersion, 158 158 "lognormal":LogNormalDispersion} -
src/sas/perspectives/fitting/basepage.py
rf0d720b r1c2bf90 57 57 ## Title to appear on top of the window 58 58 window_caption = "Fit Page " 59 60 59 # These two buttons have specific IDs since they seem to be created more 61 60 # frequently than they need to. In particular, set_dispers_sizer() is … … 1380 1379 if disp.__class__.__name__ == 'str': 1381 1380 disp_model = None 1382 com_str = "from sas models.weights "1381 com_str = "from sas.models.dispersion_models " 1383 1382 com_str += "import %s as disp_func \ndisp_model = disp_func()" 1384 1383 exec com_str % disp … … 1945 1944 name = model.__class__.__name__ 1946 1945 if models.__name__ != "NoStructure": 1947 if hasattr(model, "oldname"): 1948 name = model.oldname 1949 elif hasattr(model, "name"): 1946 if hasattr(model, "name"): 1950 1947 name = model.name 1951 1948 mlist.append((name, models)) … … 2461 2458 self.values = {} 2462 2459 self.weights = {} 2463 2464 #from sas.models.dispersion_models import GaussianDispersion 2465 from sasmodels.weights import GaussianDispersion 2460 2461 from sas.models.dispersion_models import GaussianDispersion 2466 2462 if len(self.disp_cb_dict) == 0: 2467 2463 self.save_current_state() … … 3591 3587 cat_tip = "Modify model categories \n" 3592 3588 cat_tip += "(also accessible from the menu bar)." 3593 show_cat_button.SetToolTip( wx.ToolTip(cat_tip))3589 show_cat_button.SetToolTip(wx.ToolTip(cat_tip)) 3594 3590 show_cat_button.Bind(wx.EVT_BUTTON, self._on_modify_cat) 3595 3591 sizer_cat_box.Add(self.categorybox, 1, wx.RIGHT, 3) 3596 sizer_cat_box.Add((10, 10))3592 sizer_cat_box.Add((10, 10)) 3597 3593 sizer_cat_box.Add(show_cat_button) 3598 3594 #self.shape_rbutton.SetValue(True) 3599 3595 3600 3596 sizer_radiobutton = wx.GridSizer(2, 2, 5, 5) 3601 3597 #sizer_radiobutton.Add(self.shape_rbutton) 3602 3598 #sizer_radiobutton.Add(self.shape_indep_rbutton) 3603 sizer_radiobutton.Add((5, 5))3599 sizer_radiobutton.Add((5, 5)) 3604 3600 sizer_radiobutton.Add(self.model_view, 1, wx.RIGHT, 5) 3605 3601 #sizer_radiobutton.Add(self.plugin_rbutton) -
src/sas/perspectives/fitting/models.py
rf0d720b r415fb82 6 6 import os 7 7 import sys 8 import math9 8 import os.path 10 9 # Time is needed by the log method … … 13 12 import py_compile 14 13 import shutil 15 from sas.guiframe.events import StatusEvent16 14 # Explicitly import from the pluginmodel module so that py2exe 17 15 # places it in the distribution. The Model1DPlugin class is used 18 16 # as the base class of plug-in models. 19 17 from sas.models.pluginmodel import Model1DPlugin 20 from sas.models.BaseComponent import BaseComponent21 18 from sas.guiframe.CategoryInstaller import CategoryInstaller 22 19 23 from sasmodels.sasview_model import make_class24 25 20 PLUGIN_DIR = 'plugin_models' 26 21 … … 319 314 320 315 # regular model names only 321 self.model_name_list = [] 322 323 #Build list automagically from sasmodels package 324 import pkgutil 325 from importlib import import_module 326 import sasmodels.models 327 for importer,modname,ispkg in pkgutil.iter_modules(sasmodels.models.__path__): 328 if not ispkg: 329 module = import_module('.'+modname,'sasmodels.models') 330 self.model_dictionary[module.oldname] = make_class(module, dtype='single',namestyle='oldname') 331 self.model_name_list.append(module.oldname) 332 333 334 ### NASTY HACK - Comment out most of these lines as models are added to sasmodels. 335 ### Still need the lines that put models into multiplication etc 336 337 try: 338 # # from sas.models.SphereModel import SphereModel 339 # from sasmodels.models import sphere 340 # SphereModel = make_class(sphere, dtype='single',namestyle='oldname') 341 # self.model_dictionary[SphereModel.__name__] = SphereModel 342 # # self.shape_list.append(SphereModel) 343 self.multiplication_factor.append(SphereModel) 344 # self.model_name_list.append(SphereModel.__name__) 345 except: 346 pass 316 base_message = "Unable to load model {0}" 317 try: 318 self.model_name_list = [] 319 from sas.models.SphereModel import SphereModel 320 self.model_dictionary[SphereModel.__name__] = SphereModel 321 # self.shape_list.append(SphereModel) 322 self.multiplication_factor.append(SphereModel) 323 self.model_name_list.append(SphereModel.__name__) 324 except: 325 logging.error(base_message.format(SphereModel.__name__)) 347 326 348 327 try: … … 1089 1068 new_plugins = _findModels(dir) 1090 1069 for name, plug in new_plugins.iteritems(): 1091 for stored_name, stored_plugin self.stored_plugins.iteritems():1070 for stored_name, _ in self.stored_plugins.iteritems(): 1092 1071 if name == stored_name: 1093 1072 del self.stored_plugins[name]
Note: See TracChangeset
for help on using the changeset viewer.