Changeset 6afc14b in sasview


Ignore:
Timestamp:
Apr 18, 2016 12:02:01 PM (9 years ago)
Author:
gonzalezm
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.
Message:

Merge branch 'master' of https://github.com/SasView/sasview

Files:
11 edited

Legend:

Unmodified
Added
Removed
  • sasview/README.txt

    r792e6be rfa4ea80  
    441- Features 
    55=========== 
     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 
    643 
    744   - New in Version 3.1.2 
  • sasview/__init__.py

    r792e6be rfa4ea80  
    1 __version__ = "3.1.2" 
     1__version__ = "4.0.0-alpha" 
    22__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  
    5050        self.output_unit = "cm^{-1}" 
    5151 
     52        self.is_multiplicity_model = False 
     53        self.is_structure_factor = False 
     54        self.is_form_factor = False 
     55 
    5256    def __str__(self): 
    5357        """ 
  • src/sas/sascalc/calculator/sas_gen.py

    r9e531f2 rcb4ef58  
    8080        ## Parameter details [units, min, max] 
    8181        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] 
    8989        # fixed parameters 
    9090        self.fixed = [] 
  • src/sas/sascalc/fit/MultiplicationModel.py

    r08959b8 rcb4ef58  
     1import copy 
     2 
     3import numpy 
    14 
    25from sas.sascalc.calculator.BaseComponent import BaseComponent 
    3 #import numpy, math 
    4 import copy 
    5 from sas.sascalc.fit.pluginmodel import Model1DPlugin 
     6 
    67class MultiplicationModel(BaseComponent): 
    78    r""" 
     
    4748        ## Parameter details [units, min, max] 
    4849        self._set_details() 
    49         self.details['scale_factor'] = ['',     None, None] 
     50        self.details['scale_factor'] = ['', 0.0, numpy.inf] 
    5051         
    5152        #list of parameter that can be fitted 
     
    7576                self.multiplicity_info = p_model.multiplicity_info  
    7677                self.fun_list = p_model.fun_list 
     78                self.is_multiplicity_model = True 
    7779            except: 
    7880                pass 
    7981        else: 
    80             self.multiplicity_info = [] 
     82            self.is_multiplicity_model = False 
     83            self.multiplicity_info = [0] 
    8184             
    8285    def _clone(self, obj): 
  • src/sas/sasgui/perspectives/calculator/model_editor.py

    raa03e0d rcb4ef58  
    13291329SUM_TEMPLATE = """ 
    13301330# A sample of an experimental model function for Sum/Multiply(Pmodel1,Pmodel2) 
     1331import os 
     1332import sys 
    13311333import copy 
     1334 
     1335import nuympy 
     1336 
    13321337from sas.sascalc.fit.pluginmodel import Model1DPlugin 
    13331338from sasmodels.sasview_model import make_class 
     
    13391344#P2_model: 
    13401345#from %s import Model as P2 
    1341 import os 
    1342 import sys 
    13431346 
    13441347class Model(Model1DPlugin): 
     
    13851388        ## Parameter details [units, min, max] 
    13861389        self._set_details() 
    1387         self.details['scale_factor'] = ['', None, None] 
     1390        self.details['scale_factor'] = ['', 0.0, numpy.inf] 
    13881391 
    13891392 
  • src/sas/sasgui/perspectives/fitting/basepage.py

    r08959b8 rcb4ef58  
    18961896                for model in self.model_list_box[mod_cat]: 
    18971897                    if 'sasmodels.sasview_model.' in str(model): 
    1898                         str_m = model._model_info['id'] 
     1898                        str_m = model.id 
    18991899                    else: 
    19001900                        str_m = str(model).split(".")[0] 
     
    19451945        mlist = [] 
    19461946        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)) 
    19521949 
    19531950        # Sort the models 
     
    20992096        if form_factor != None: 
    21002097            # 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: 
    21032099                m_id = self.multifactorbox.GetCurrentSelection() 
    2104                 multiplicity = form_factor().multiplicity_info[0] 
     2100                multiplicity = form_factor.multiplicity_info[0] 
    21052101                self.multifactorbox.Clear() 
    21062102                self._set_multfactor_combobox(multiplicity) 
    21072103                self._show_multfactor_combobox() 
    21082104                #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: ' 
    21102106 
    21112107                self.mutifactor_text.SetLabel(text) 
     
    21172113                if self.multi_factor == None: 
    21182114                    self.multi_factor = 0 
    2119                 form_factor = form_factor(int(self.multi_factor)) 
    21202115                self.multifactorbox.SetSelection(m_id) 
    21212116                # Check len of the text1 and max_multiplicity 
     
    21312126                else: 
    21322127                    self.sld_axes = "" 
    2133  
    21342128            else: 
    21352129                self._hide_multfactor_combobox() 
    21362130                self.show_sld_button.Hide() 
    2137                 form_factor = form_factor() 
    21382131                self.multi_factor = None 
    21392132        else: 
     
    21472140        if  struct_factor != None: 
    21482141            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()) 
    21502144            # multifunctional form factor 
    21512145            if len(form_factor.non_fittable) > 0: 
    21522146                self.temp_multi_functional = True 
     2147        elif form_factor != None: 
     2148            self.model = form_factor(self.multi_factor) 
    21532149        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 
    21592153        # check if model has magnetic parameters 
    21602154        if len(self.model.magnetic_params) > 0: 
     
    22862280                parameter's error of fit, 
    22872281                parameter's minimum value, 
    2288                 parrameter's maximum value , 
     2282                parameter's maximum value , 
    22892283                parameter's units] 
    22902284        """ 
  • src/sas/sasgui/perspectives/fitting/fitpage.py

    rf27dd1e rcb4ef58  
    1010import math 
    1111import time 
     12 
     13from sasmodels.weights import MODELS as POLYDISPERSITY_MODELS 
     14 
    1215from sas.sasgui.guiframe.events import StatusEvent 
    1316from sas.sasgui.guiframe.events import NewPlotEvent 
     
    621624        model_disp = wx.StaticText(self, wx.ID_ANY, 'Function') 
    622625        CHECK_STATE = self.cb1.GetValue() 
    623         #import sas.models.dispersion_models 
    624         #self.polydisp = sas.models.dispersion_models.models 
    625         import sasmodels.weights 
    626         self.polydisp =  sasmodels.weights.models 
    627626 
    628627        ix = 0 
     
    784783                disp_box = wx.ComboBox(self, wx.ID_ANY, size=(65, -1), 
    785784                                       style=wx.CB_READONLY, name='%s' % name1) 
    786                 for key, value in self.polydisp.iteritems(): 
     785                for key, value in POLYDISPERSITY_MODELS.iteritems(): 
    787786                    name_disp = str(key) 
    788787                    disp_box.Append(name_disp, value) 
     
    948947                disp_box = wx.ComboBox(self, wx.ID_ANY, size=(65, -1), 
    949948                                style=wx.CB_READONLY, name='%s' % name1) 
    950                 for key, value in self.polydisp.iteritems(): 
     949                for key, value in POLYDISPERSITY_MODELS.iteritems(): 
    951950                    name_disp = str(key) 
    952951                    disp_box.Append(name_disp, value) 
  • src/sas/sasgui/perspectives/fitting/models.py

    r70e5f97 r6afc14b  
    296296        #Build list automagically from sasmodels package 
    297297        for model in load_standard_models(): 
    298             self.model_dictionary[model._model_info['name']] = model 
    299             if model._model_info['structure_factor'] == True: 
     298            self.model_dictionary[model.name] = model 
     299            if model.is_structure_factor: 
    300300                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: 
    302304                self.multi_func_list.append(model) 
    303305            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) 
    307307 
    308308        #Looking for plugins 
     
    387387        Get the multifunctional models 
    388388        """ 
    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 
    397391 
    398392    def get_model_list(self): 
  • src/sas/sasgui/plottools/PlotPanel.py

    rd85c194 r16b769b  
    19941994        """ 
    19951995        try: 
    1996             self.toolbar.copy_figure() 
     1996            self.toolbar.copy_figure(self.canvas) 
    19971997        except: 
    19981998            print "Error in copy Image" 
Note: See TracChangeset for help on using the changeset viewer.