Changes in / [1c2bf90:02098e3] in sasview
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
.gitignore
rbc873053 rf0d720b 13 13 .pydevproject 14 14 .vagrant 15 .idea 16 build 17 dist 18 sasview.egg-info 19 sasview.egg-info 20 15 21 .mplconfig 22 doctrees 23 html 24 build 16 25 17 26 /setup.cfg 18 27 19 28 /dist 20 /build29 **/build 21 30 sasview.egg-info 22 31 sasview-install … … 41 50 /test/sasdataloader/test/plugins.zip 42 51 /test/sasdataloader/test/test_log.txt 52 -
run.py
rf9393dc rf9393dc 104 104 addpath(joinpath(root, 'src')) 105 105 106 # sasmodels on the path 107 addpath(joinpath(root, '../sasmodels/')) 108 106 109 # Import the sasview package from root/sasview as sas.sasview. It would 107 110 # 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") 342 343 # SasView 343 344 … … 350 351 'test/save_states/*', 351 352 'test/upcoming_formats/*', 352 'default_categories.json']353 'default_categories.json'] 353 354 packages.append("sas.sasview") 354 355 -
src/sas/models/dispersion_models.py
rfd5ac0d r0e4e554 154 154 c_models.set_dispersion_weights(self.cdisp, values, weights) 155 155 156 models = {"gaussian":GaussianDispersion, "rectangula ":RectangleDispersion,156 models = {"gaussian":GaussianDispersion, "rectangular":RectangleDispersion, 157 157 "array":ArrayDispersion, "schulz":SchulzDispersion, 158 158 "lognormal":LogNormalDispersion} -
src/sas/perspectives/fitting/basepage.py
r1c2bf90 rf0d720b 57 57 ## Title to appear on top of the window 58 58 window_caption = "Fit Page " 59 59 60 # These two buttons have specific IDs since they seem to be created more 60 61 # frequently than they need to. In particular, set_dispers_sizer() is … … 1379 1380 if disp.__class__.__name__ == 'str': 1380 1381 disp_model = None 1381 com_str = "from sas .models.dispersion_models "1382 com_str = "from sasmodels.weights " 1382 1383 com_str += "import %s as disp_func \ndisp_model = disp_func()" 1383 1384 exec com_str % disp … … 1944 1945 name = model.__class__.__name__ 1945 1946 if models.__name__ != "NoStructure": 1946 if hasattr(model, "name"): 1947 if hasattr(model, "oldname"): 1948 name = model.oldname 1949 elif hasattr(model, "name"): 1947 1950 name = model.name 1948 1951 mlist.append((name, models)) … … 2458 2461 self.values = {} 2459 2462 self.weights = {} 2460 2461 from sas.models.dispersion_models import GaussianDispersion 2463 2464 #from sas.models.dispersion_models import GaussianDispersion 2465 from sasmodels.weights import GaussianDispersion 2462 2466 if len(self.disp_cb_dict) == 0: 2463 2467 self.save_current_state() … … 3587 3591 cat_tip = "Modify model categories \n" 3588 3592 cat_tip += "(also accessible from the menu bar)." 3589 show_cat_button.SetToolTip( wx.ToolTip(cat_tip))3593 show_cat_button.SetToolTip( wx.ToolTip(cat_tip) ) 3590 3594 show_cat_button.Bind(wx.EVT_BUTTON, self._on_modify_cat) 3591 3595 sizer_cat_box.Add(self.categorybox, 1, wx.RIGHT, 3) 3592 sizer_cat_box.Add((10, 3596 sizer_cat_box.Add((10,10)) 3593 3597 sizer_cat_box.Add(show_cat_button) 3594 3598 #self.shape_rbutton.SetValue(True) 3595 3599 3596 3600 sizer_radiobutton = wx.GridSizer(2, 2, 5, 5) 3597 3601 #sizer_radiobutton.Add(self.shape_rbutton) 3598 3602 #sizer_radiobutton.Add(self.shape_indep_rbutton) 3599 sizer_radiobutton.Add((5, 3603 sizer_radiobutton.Add((5,5)) 3600 3604 sizer_radiobutton.Add(self.model_view, 1, wx.RIGHT, 5) 3601 3605 #sizer_radiobutton.Add(self.plugin_rbutton) -
src/sas/perspectives/fitting/models.py
r415fb82 rf0d720b 6 6 import os 7 7 import sys 8 import math 8 9 import os.path 9 10 # Time is needed by the log method … … 12 13 import py_compile 13 14 import shutil 15 from sas.guiframe.events import StatusEvent 14 16 # Explicitly import from the pluginmodel module so that py2exe 15 17 # places it in the distribution. The Model1DPlugin class is used 16 18 # as the base class of plug-in models. 17 19 from sas.models.pluginmodel import Model1DPlugin 20 from sas.models.BaseComponent import BaseComponent 18 21 from sas.guiframe.CategoryInstaller import CategoryInstaller 19 22 23 from sasmodels.sasview_model import make_class 24 20 25 PLUGIN_DIR = 'plugin_models' 21 26 … … 314 319 315 320 # regular model names only 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__)) 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 326 347 327 348 try: … … 1068 1089 new_plugins = _findModels(dir) 1069 1090 for name, plug in new_plugins.iteritems(): 1070 for stored_name, _in self.stored_plugins.iteritems():1091 for stored_name, stored_plug in self.stored_plugins.iteritems(): 1071 1092 if name == stored_name: 1072 1093 del self.stored_plugins[name]
Note: See TracChangeset
for help on using the changeset viewer.