Changeset 6afc14b in sasview
- Timestamp:
- Apr 18, 2016 12:02:01 PM (9 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, costrafo411, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- b768e92
- Parents:
- 70e5f97 (diff), 42585bf (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
sasview/README.txt
r792e6be rfa4ea80 4 4 1- Features 5 5 =========== 6 7 - New in Version 4.0.0-alpha 8 -------------------- 9 This alpha release brings a major overhaul of the model system. The new model 10 package allows rapid integration of custom models and access to polydispersity 11 without requiring a compiler. 12 13 - Model package changes and improvements 14 - Model interface moved to independent sasmodels package. 15 - Most models converted to new interface. 16 - Allows rapid integration of user-written models. 17 - OpenCL GPU utilization for faster fitting. 18 - Improved numerical integration of Bessel functions. 19 - SESANS integration and implementation 20 - Scripting interface added for analysis of SESANS data. 21 - Hankel transformation now accepts finite acceptance angles. 22 - 2D cosine transformation added for TOF SESANS analysis. 23 - Documentation improvements 24 - The documentation tree was restructured for a better end user experience. 25 - The documentation for each model was revamped and verified by at least 26 two people following the conversion of the model. 27 - Theoretical 1D (and 2D if applicable) scattering curves are auto-generated 28 and added to the model documentation for each model. 29 - Separation of GUI and calculations for future GUI enhancements 30 - Bug fixes 31 - Fixes bug #411 No stop button on simultaneous fit page 32 - Fixes bug #410 Error with raspberry model 33 - Fixes bug #364 Possible inconsistency in Poly_GausCoil model 34 - Fixes bug #439 Hayter Penfold MSA code needs checking 35 - Fixes bug #484 lammellerPC is precision limited 36 - Fixes bug #498 $HOME/.matplotlib conflicts 37 - Fixes bug #348 Control order in which fit parameters appear in the gui 38 - Fixes bug #456 Provide DREAM Results Panel with something to identify 39 data and age of results 40 - Fixes bug #556 Build script improvements for developers 41 42 6 43 7 44 - New in Version 3.1.2 -
sasview/__init__.py
r792e6be rfa4ea80 1 __version__ = " 3.1.2"1 __version__ = "4.0.0-alpha" 2 2 __build__ = "1" -
sasview/default_categories.json
r6313823 r42585bf 1 {"Shapes": [[" barbell", true], ["pearl_necklace", true], ["hollow_cylinder", true], ["CoreMultiShellModel", true], ["fcc_paracrystal", true], ["parallelepiped", true], ["fuzzy_sphere", true], ["core_shell_ellipsoid_xt", true], ["lamellarPC", true], ["bcc_paracrystal", true], ["ellptical_cylinder", true], ["hollow_rectangular_prism_infinitely_thin_walls", true], ["core_shell_parallelepiped", true], ["OnionExpShellModel", true], ["multi_shell", true], ["raspberry", true], ["core_shell_ellipsoid", true], ["capped_cylinder", true], ["cylinder", true], ["SphericalSLDModel", true], ["sc_crystal", true], ["stacked_disks", true], ["LamellarPSHGModel", true], ["core_shell_bicelle", true], ["hollow_rectangular_prism", true], ["LamellarPSModel", true], ["ellipsoid", true], ["sphere", true], ["vesicle", true], ["triaxial_ellipsoid", true], ["lamellar", true], ["pringles", true], ["rectangular_prism", true], ["core_shell_cylinder", true], ["BinaryHSModel", true], ["flexible_cylinder", true], ["lamellarFFHG", true], ["flexible_cylinder_ex", true], ["linear_pearls", true], ["core_shell_sphere", true]], "Structure Factor": [["squarewell", true], ["hayter_msa", true], ["hardsphere", true], ["stickyhardsphere", true]], "Shape-Independent": [["two_power_law", true], ["gel_fit", true], ["dab", true], ["power_law", true], ["porod", true], ["guinier", true], ["rpa", true], ["teubner_strey", true], ["star_polymer", true], ["UnifiedPowerRgModel", true], ["mass_surface_fractal", true], ["adsorbed_layer", true], ["two_lorentzian", true], ["mono_gauss_coil", true], ["mass_fractal", true], ["guinier_porod", true], ["correlation_length", true], ["polymer_excl_volume", true], ["FractalModel", true], ["peak_lorentz", true], ["broad_peak", true], ["fractal_core_shell", true], ["gaussian_peak", true], ["be_polyelectrolyte", true], ["poly_gauss_coil", true], ["surface_fractal", true], ["gauss_lorentz_gel", true], ["lorentz", true]], "Uncategorized": [["ReflectivityModel", true], ["ReflectivityIIModel", true], ["line", true], ["micell_spherical_coil", true]]}1 {"Shapes": [["cylinder", true], ["lamellar_stack_paracrystal", true], ["multilayer_vesicle", true], ["core_shell_cylinder", true], ["lamellar_hg", true], ["fuzzy_sphere", true], ["sphere", true], ["triaxial_ellipsoid", true], ["rectangular_prism", true], ["core_shell_bicelle", true], ["flexible_cylinder", true], ["flexible_cylinder_elliptical", true], ["binary_hard_sphere", true], ["core_multi_shell", true], ["sc_paracrystal", true], ["ellipsoid", true], ["capped_cylinder", true], ["core_shell_ellipsoid", true], ["fcc_paracrystal", true], ["core_shell_parallelepiped", true], ["core_shell_ellipsoid_xt", true], ["elliptical_cylinder", true], ["pringle", true], ["hollow_rectangular_prism_thin_walls", true], ["hollow_rectangular_prism", true], ["vesicle", true], ["polymer_micelle", true], ["parallelepiped", true], ["hollow_cylinder", true], ["linear_pearls", true], ["spherical_sld", true], ["raspberry", true], ["lamellar_hg_stack_caille", true], ["pearl_necklace", true], ["lamellar", true], ["onion", true], ["lamellar_stack_caille", true], ["bcc_paracrystal", true], ["core_shell_sphere", true], ["stacked_disks", true]], "Structure Factor": [["hayter_msa", true], ["squarewell", true], ["stickyhardsphere", true], ["hardsphere", true]], "Shape-Independent": [["guinier_porod", true], ["polymer_excl_volume", true], ["gel_fit", true], ["teubner_strey", true], ["mono_gauss_coil", true], ["mass_surface_fractal", true], ["mass_fractal", true], ["adsorbed_layer", true], ["two_lorentzian", true], ["fractal", true], ["fractal_core_shell", true], ["dab", true], ["poly_gauss_coil", true], ["star_polymer", true], ["broad_peak", true], ["surface_fractal", true], ["two_power_law", true], ["power_law", true], ["rpa", true], ["be_polyelectrolyte", true], ["peak_lorentz", true], ["guinier", true], ["correlation_length", true], ["line", true], ["gaussian_peak", true], ["porod", true], ["gauss_lorentz_gel", true], ["lorentz", true]]} -
src/sas/sascalc/calculator/BaseComponent.py
r53aa66d rcb4ef58 50 50 self.output_unit = "cm^{-1}" 51 51 52 self.is_multiplicity_model = False 53 self.is_structure_factor = False 54 self.is_form_factor = False 55 52 56 def __str__(self): 53 57 """ -
src/sas/sascalc/calculator/sas_gen.py
r9e531f2 rcb4ef58 80 80 ## Parameter details [units, min, max] 81 81 self.details = {} 82 self.details['scale'] = ['', None, None]83 self.details['background'] = ['[1/cm]', None, None]84 self.details['solvent_SLD'] = ['1/A^(2)', None, None]85 self.details['total_volume'] = ['A^(3)', None, None]86 self.details['Up_frac_in'] = ['[u/(u+d)]', None, None]87 self.details['Up_frac_out'] = ['[u/(u+d)]', None, None]88 self.details['Up_theta'] = ['[deg]', None, None]82 self.details['scale'] = ['', 0.0, numpy.inf] 83 self.details['background'] = ['[1/cm]', 0.0, numpy.inf] 84 self.details['solvent_SLD'] = ['1/A^(2)', -numpy.inf, numpy.inf] 85 self.details['total_volume'] = ['A^(3)', 0.0, numpy.inf] 86 self.details['Up_frac_in'] = ['[u/(u+d)]', 0.0, 1.0] 87 self.details['Up_frac_out'] = ['[u/(u+d)]', 0.0, 1.0] 88 self.details['Up_theta'] = ['[deg]', -numpy.inf, numpy.inf] 89 89 # fixed parameters 90 90 self.fixed = [] -
src/sas/sascalc/fit/MultiplicationModel.py
r08959b8 rcb4ef58 1 import copy 2 3 import numpy 1 4 2 5 from sas.sascalc.calculator.BaseComponent import BaseComponent 3 #import numpy, math 4 import copy 5 from sas.sascalc.fit.pluginmodel import Model1DPlugin 6 6 7 class MultiplicationModel(BaseComponent): 7 8 r""" … … 47 48 ## Parameter details [units, min, max] 48 49 self._set_details() 49 self.details['scale_factor'] = ['', None, None]50 self.details['scale_factor'] = ['', 0.0, numpy.inf] 50 51 51 52 #list of parameter that can be fitted … … 75 76 self.multiplicity_info = p_model.multiplicity_info 76 77 self.fun_list = p_model.fun_list 78 self.is_multiplicity_model = True 77 79 except: 78 80 pass 79 81 else: 80 self.multiplicity_info = [] 82 self.is_multiplicity_model = False 83 self.multiplicity_info = [0] 81 84 82 85 def _clone(self, obj): -
src/sas/sasgui/perspectives/calculator/model_editor.py
raa03e0d rcb4ef58 1329 1329 SUM_TEMPLATE = """ 1330 1330 # A sample of an experimental model function for Sum/Multiply(Pmodel1,Pmodel2) 1331 import os 1332 import sys 1331 1333 import copy 1334 1335 import nuympy 1336 1332 1337 from sas.sascalc.fit.pluginmodel import Model1DPlugin 1333 1338 from sasmodels.sasview_model import make_class … … 1339 1344 #P2_model: 1340 1345 #from %s import Model as P2 1341 import os1342 import sys1343 1346 1344 1347 class Model(Model1DPlugin): … … 1385 1388 ## Parameter details [units, min, max] 1386 1389 self._set_details() 1387 self.details['scale_factor'] = ['', None, None]1390 self.details['scale_factor'] = ['', 0.0, numpy.inf] 1388 1391 1389 1392 -
src/sas/sasgui/perspectives/fitting/basepage.py
r08959b8 rcb4ef58 1896 1896 for model in self.model_list_box[mod_cat]: 1897 1897 if 'sasmodels.sasview_model.' in str(model): 1898 str_m = model. _model_info['id']1898 str_m = model.id 1899 1899 else: 1900 1900 str_m = str(model).split(".")[0] … … 1945 1945 mlist = [] 1946 1946 for models in list: 1947 model = models() 1948 name = model.__class__.__name__ 1949 if models.__name__ != "NoStructure": 1950 name = model.name 1951 mlist.append((name, models)) 1947 if models.name != "NoStructure": 1948 mlist.append((models.name, models)) 1952 1949 1953 1950 # Sort the models … … 2099 2096 if form_factor != None: 2100 2097 # set multifactor for Mutifunctional models 2101 if form_factor().__class__ in \ 2102 self.model_list_box["Multi-Functions"]: 2098 if form_factor.is_multiplicity_model: 2103 2099 m_id = self.multifactorbox.GetCurrentSelection() 2104 multiplicity = form_factor ().multiplicity_info[0]2100 multiplicity = form_factor.multiplicity_info[0] 2105 2101 self.multifactorbox.Clear() 2106 2102 self._set_multfactor_combobox(multiplicity) 2107 2103 self._show_multfactor_combobox() 2108 2104 #ToDo: this info should be called directly from the model 2109 text = form_factor ().multiplicity_info[1] # 'No. of Shells: '2105 text = form_factor.multiplicity_info[1] # 'No. of Shells: ' 2110 2106 2111 2107 self.mutifactor_text.SetLabel(text) … … 2117 2113 if self.multi_factor == None: 2118 2114 self.multi_factor = 0 2119 form_factor = form_factor(int(self.multi_factor))2120 2115 self.multifactorbox.SetSelection(m_id) 2121 2116 # Check len of the text1 and max_multiplicity … … 2131 2126 else: 2132 2127 self.sld_axes = "" 2133 2134 2128 else: 2135 2129 self._hide_multfactor_combobox() 2136 2130 self.show_sld_button.Hide() 2137 form_factor = form_factor()2138 2131 self.multi_factor = None 2139 2132 else: … … 2147 2140 if struct_factor != None: 2148 2141 from sas.sascalc.fit.MultiplicationModel import MultiplicationModel 2149 self.model = MultiplicationModel(form_factor, struct_factor()) 2142 self.model = MultiplicationModel(form_factor(self.multi_factor), 2143 struct_factor()) 2150 2144 # multifunctional form factor 2151 2145 if len(form_factor.non_fittable) > 0: 2152 2146 self.temp_multi_functional = True 2147 elif form_factor != None: 2148 self.model = form_factor(self.multi_factor) 2153 2149 else: 2154 if form_factor != None: 2155 self.model = form_factor 2156 else: 2157 self.model = None 2158 return self.model 2150 self.model = None 2151 return 2152 2159 2153 # check if model has magnetic parameters 2160 2154 if len(self.model.magnetic_params) > 0: … … 2286 2280 parameter's error of fit, 2287 2281 parameter's minimum value, 2288 par rameter's maximum value ,2282 parameter's maximum value , 2289 2283 parameter's units] 2290 2284 """ -
src/sas/sasgui/perspectives/fitting/fitpage.py
rf27dd1e rcb4ef58 10 10 import math 11 11 import time 12 13 from sasmodels.weights import MODELS as POLYDISPERSITY_MODELS 14 12 15 from sas.sasgui.guiframe.events import StatusEvent 13 16 from sas.sasgui.guiframe.events import NewPlotEvent … … 621 624 model_disp = wx.StaticText(self, wx.ID_ANY, 'Function') 622 625 CHECK_STATE = self.cb1.GetValue() 623 #import sas.models.dispersion_models624 #self.polydisp = sas.models.dispersion_models.models625 import sasmodels.weights626 self.polydisp = sasmodels.weights.models627 626 628 627 ix = 0 … … 784 783 disp_box = wx.ComboBox(self, wx.ID_ANY, size=(65, -1), 785 784 style=wx.CB_READONLY, name='%s' % name1) 786 for key, value in self.polydisp.iteritems():785 for key, value in POLYDISPERSITY_MODELS.iteritems(): 787 786 name_disp = str(key) 788 787 disp_box.Append(name_disp, value) … … 948 947 disp_box = wx.ComboBox(self, wx.ID_ANY, size=(65, -1), 949 948 style=wx.CB_READONLY, name='%s' % name1) 950 for key, value in self.polydisp.iteritems():949 for key, value in POLYDISPERSITY_MODELS.iteritems(): 951 950 name_disp = str(key) 952 951 disp_box.Append(name_disp, value) -
src/sas/sasgui/perspectives/fitting/models.py
r70e5f97 r6afc14b 296 296 #Build list automagically from sasmodels package 297 297 for model in load_standard_models(): 298 self.model_dictionary[model. _model_info['name']] = model299 if model. _model_info['structure_factor'] == True:298 self.model_dictionary[model.name] = model 299 if model.is_structure_factor: 300 300 self.struct_list.append(model) 301 if model._model_info['variant_info'] is not None: 301 if model.is_form_factor: 302 self.multiplication_factor.append(model) 303 if model.is_multiplicity_model: 302 304 self.multi_func_list.append(model) 303 305 else: 304 self.model_name_list.append(model._model_info['name']) 305 if model._model_info['ER'] is not None: 306 self.multiplication_factor.append(model) 306 self.model_name_list.append(model.name) 307 307 308 308 #Looking for plugins … … 387 387 Get the multifunctional models 388 388 """ 389 for item in self.plugins: 390 try: 391 # check the multiplicity if any 392 if item.multiplicity_info[0] > 1: 393 self.multi_func_list.append(item) 394 except: 395 # pass to other items 396 pass 389 items = [item for item in self.plugins if item.is_multiplicity_model] 390 self.multi_func_list = items 397 391 398 392 def get_model_list(self): -
src/sas/sasgui/plottools/PlotPanel.py
rd85c194 r16b769b 1994 1994 """ 1995 1995 try: 1996 self.toolbar.copy_figure( )1996 self.toolbar.copy_figure(self.canvas) 1997 1997 except: 1998 1998 print "Error in copy Image"
Note: See TracChangeset
for help on using the changeset viewer.