Changes in / [e64a03e:71601312] in sasview


Ignore:
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • setup.py

    r1e13b53 r18e7309  
    206206) 
    207207 
     208 
    208209# sas.sascalc.pr 
    209210srcdir  = os.path.join("src", "sas", "sascalc", "pr", "c_extensions") 
     
    228229                              ) ) 
    229230 
    230 #sas.sascalc.corfunc 
    231 package_dir["sas.sascalc.corfunc"] = os.path.join("src", "sas", "sascalc", "corfunc") 
    232 packages.extend(["sas.sascalc.corfunc"]) 
    233  
    234231# sas.sascalc.fit 
    235232package_dir["sas.sascalc.fit"] = os.path.join("src", "sas", "sascalc", "fit") 
     
    240237package_dir["sas.sasgui.perspectives.pr"] = os.path.join("src", "sas", "sasgui", "perspectives", "pr") 
    241238packages.extend(["sas.sasgui.perspectives","sas.sasgui.perspectives.pr"]) 
    242 package_data["sas.sasgui.perspectives.pr"] = ['media/*'] 
     239package_data["sas.sasgui.perspectives.pr"] = ['images/*'] 
    243240 
    244241package_dir["sas.sasgui.perspectives.invariant"] = os.path.join("src", "sas", "sasgui", "perspectives", "invariant") 
     
    253250packages.extend(["sas.sasgui.perspectives", "sas.sasgui.perspectives.calculator"]) 
    254251package_data['sas.sasgui.perspectives.calculator'] = ['images/*', 'media/*'] 
    255  
    256 package_dir["sas.sasgui.perspectives.corfunc"] = os.path.join("src", "sas", "sasgui", "perspectives", "corfunc") 
    257 packages.extend(["sas.sasgui.perspectives.corfunc"]) 
    258 package_data['sas.sasgui.perspectives.corfunc'] = ['media/*'] 
    259  
    260 package_dir["sas.sasgui.perspectives.file_converter"] = os.path.join("src", "sas", "sasgui", "perspectives", "file_converter") 
    261 packages.extend(["sas.sasgui.perspectives.file_converter"]) 
    262 package_data['sas.sasgui.perspectives.file_converter'] = ['media/*'] 
    263252 
    264253# Data util 
  • src/sas/sascalc/dataloader/readers/sesans_reader.py

    r9525358 r345e7e4  
    166166                output.dlam, output.dlam_unit = self._unit_conversion(dlam, lam_unit, default_z_unit) 
    167167 
    168                 output.xaxis(r"\rm{z}", output.x_unit) 
    169                 output.yaxis(r"\rm{P/P0}", output.y_unit) 
     168                output.xaxis("\rm{z}", output.x_unit) 
     169                output.yaxis("\\rm{P/P0}", output.y_unit) 
    170170                # Store loading process information 
    171171                output.meta_data['loader'] = self.type_name 
     
    175175                zaccept_unit_split = paramnames[7].split("[") 
    176176                zaccept_unit = zaccept_unit_split[1].replace("]","") 
    177                 if zaccept_unit.strip() == r'\AA^-1': 
     177                if zaccept_unit.strip() == '\AA^-1': 
    178178                    zaccept_unit = "1/A" 
    179179                output.sample.zacceptance=(float(paramvals[7]),zaccept_unit) 
  • src/sas/sasgui/guiframe/CategoryInstaller.py

    rddbac66 r212bfc2  
    123123        compile it and install 
    124124        :param homefile: Override the default home directory 
    125         :param model_list: List of model names except those in Plugin Models 
    126                which are user supplied. 
     125        :param model_list: List of model names except customized models 
    127126        """ 
    128127        _model_dict = { model.name: model for model in model_list} 
  • src/sas/sasgui/perspectives/calculator/model_editor.py

    rddbac66 ra08b89b  
    55function of y (usually the intensity).  It also provides a drop down of 
    66standard available math functions.  Finally a full python editor panel for 
    7 complete customization is provided. 
    8  
    9 :TODO the writing of the file and name checking (and maybe some other 
    10 functions?) should be moved to a computational module which could be called 
    11 from a python script.  Basically one just needs to pass the name, 
     7complete customizatin is provided. 
     8 
     9:TODO the writiong of the file and name checking (and maybe some other 
     10funtions?) should be moved to a computational module which could be called 
     11fropm a python script.  Basically one just needs to pass the name, 
    1212description text and function text (or in the case of the composite editor 
    1313the names of the first and second model and the operator to be used). 
     
    6161    """ 
    6262    Dialog for easy custom composite models.  Provides a wx.Dialog panel 
    63     to choose two existing models (including pre-existing Plugin Models which 
     63    to choose two existing models (including pre-existing custom models which 
    6464    may themselves be composite models) as well as an operation on those models 
    6565    (add or multiply) the resulting model will add a scale parameter for summed 
     
    380380            color = 'blue' 
    381381        except: 
    382             msg = "Easy Sum/Multipy Plugin: Error occurred..." 
     382            msg = "Easy Custom Sum/Multipy: Error occurred..." 
    383383            info = 'Error' 
    384384            color = 'red' 
     
    501501        self.factor = factor 
    502502        self._operator = operator 
    503         self.explanation = "  Plugin Model = %s %s (model1 %s model2)\n" % \ 
     503        self.explanation = "  Custom Model = %s %s (model1 %s model2)\n" % \ 
    504504                           (self.factor, f_oper, self._operator) 
    505505        self.explanationctr.SetLabel(self.explanation) 
     
    617617class EditorPanel(wx.ScrolledWindow): 
    618618    """ 
    619     Simple Plugin Model function editor 
     619    Custom model function editor 
    620620    """ 
    621621    def __init__(self, parent, base, path, title, *args, **kwds): 
     
    652652        self.msg_sizer = None 
    653653        self.warning = "" 
    654         #This does not seem to be used anywhere so commenting out for now 
    655         #    -- PDB 2/26/17  
    656         #self._description = "New Plugin Model" 
     654        self._description = "New Custom Model" 
    657655        self.function_tcl = None 
    658656        self.math_combo = None 
     
    993991        else: 
    994992            self._notes = result 
    995             msg = "Successful! Please look for %s in Plugin Models."%name 
     993            msg = "Successful! Please look for %s in Customized Models."%name 
    996994            msg += "  " + self._notes 
    997995            info = 'Info' 
     
    11401138    def on_help(self, event): 
    11411139        """ 
    1142         Bring up the New Plugin Model Editor Documentation whenever 
     1140        Bring up the Custom Model Editor Documentation whenever 
    11431141        the HELP button is clicked. 
    11441142 
     
    11921190        #self.Destroy() 
    11931191 
    1194 ## Templates for plugin models 
     1192## Templates for custom models 
    11951193 
    11961194CUSTOM_TEMPLATE = """ 
  • src/sas/sasgui/perspectives/calculator/pyconsole.py

    rddbac66 rd472e86  
    302302        success = show_model_output(self, fname) 
    303303 
    304         # Update plugin model list in fitpage combobox 
     304        # Update custom model list in fitpage combobox 
    305305        if success and self._manager != None and self.panel != None: 
    306306            self._manager.set_edit_menu_helper(self.parent) 
  • src/sas/sasgui/perspectives/fitting/fitpage.py

    r3d55219 r4387385  
    362362        self.Bind(wx.EVT_RADIOBUTTON, self.onSlitSmear, 
    363363                  id=self.slit_smearer.GetId()) 
    364         self.disable_smearer.SetValue(True) 
     364        self.enable_smearer.SetValue(True) 
    365365 
    366366        sizer_smearer.Add(self.disable_smearer, 0, wx.LEFT, 10) 
     
    19341934 
    19351935            # more disables for 2D 
    1936             di_flag = False 
    1937             dq_flag = False 
    19381936            if self.data.__class__.__name__ == "Data2D" or \ 
    19391937                        self.enable2D: 
     
    19411939                self.pinhole_smearer.Enable(True) 
    19421940                self.default_mask = copy.deepcopy(self.data.mask) 
    1943                 if self.data.err_data is not None \ 
    1944                         and numpy.any(self.data.err_data): 
    1945                     di_flag = True 
    1946                 if self.data.dqx_data is not None \ 
    1947                         and numpy.any(self.data.dqx_data): 
    1948                     dq_flag = True 
     1941                if self.data.err_data is None or\ 
     1942                        numpy.all(err == 1 for err in self.data.err_data) or \ 
     1943                        not numpy.any(self.data.err_data): 
     1944                    self.dI_didata.Enable(False) 
     1945                    self.dI_noweight.SetValue(True) 
     1946                    self.weightbt_string = self.dI_noweight.GetLabelText() 
     1947                else: 
     1948                    self.dI_didata.Enable(True) 
     1949                    self.dI_didata.SetValue(True) 
     1950                    self.weightbt_string = self.dI_didata.GetLabelText() 
    19491951            else: 
    19501952                self.slit_smearer.Enable(True) 
    19511953                self.pinhole_smearer.Enable(True) 
    1952                 if self.data.dy is not None and numpy.any(self.data.dy): 
    1953                     di_flag = True 
    1954                 if self.data.dx is not None and numpy.any(self.data.dx): 
    1955                     dq_flag = True 
    1956                 elif self.data.dxl is not None and numpy.any(self.data.dxl): 
    1957                     dq_flag = True 
    1958  
    1959             if dq_flag: 
    1960                 self.enable_smearer.Enable(True) 
    1961                 self.enable_smearer.SetValue(True) 
    1962                 self.disable_smearer.SetValue(False) 
    1963             else: 
    1964                 self.enable_smearer.Disable() 
    1965                 self.disable_smearer.Enable(True) 
    1966                 self.disable_smearer.SetValue(True) 
    1967  
    1968             if di_flag: 
    1969                 self.dI_didata.Enable(True) 
    1970                 self.dI_didata.SetValue(True) 
    1971                 self.weightbt_string = self.dI_didata.GetLabelText() 
    1972             else: 
    1973                 self.dI_didata.Enable(False) 
    1974                 self.dI_noweight.SetValue(True) 
    1975                 self.weightbt_string = self.dI_noweight.GetLabelText() 
    1976  
     1954 
     1955                if self.data.dy is None or\ 
     1956                     numpy.all(self.data.dy == 1) or\ 
     1957                     not numpy.any(self.data.dy): 
     1958                    self.dI_didata.Enable(False) 
     1959                    self.dI_noweight.SetValue(True) 
     1960                    self.weightbt_string = self.dI_noweight.GetLabelText() 
     1961                else: 
     1962                    self.dI_didata.Enable(True) 
     1963                    self.dI_didata.SetValue(True) 
     1964                    self.weightbt_string = self.dI_didata.GetLabelText() 
    19771965            # Enable weighting radio buttons 
    19781966            self.dI_noweight.Enable(True) 
     
    20162004            self.EditMask_title.Disable() 
    20172005 
    2018         self.onSmear(event=None) 
    20192006        self.on_set_focus(None) 
    20202007        self.Refresh() 
  • src/sas/sasgui/perspectives/fitting/fitting.py

    rddbac66 re92a352  
    19641964                ## then kill itself but cannot.  Paul Kienzle came up with 
    19651965                ## this fix to prevent threads from stepping on each other 
    1966                 ## which was causing a simple custom plugin model to crash 
    1967                 ##Sasview. 
     1966                ## which was causing a simple custom model to crash Sasview. 
    19681967                ## We still don't know why the fit sometimes lauched a second 
    19691968                ## thread -- something which should also be investigated. 
  • src/sas/sasgui/perspectives/fitting/media/fitting_help.rst

    r5295cf5 r26c8be3  
    3434*  in *Single* fit mode - individual data sets are fitted independently one-by-one 
    3535 
    36 *  in *Simultaneous* fit mode - multiple data sets are fitted simultaneously to 
    37    the *same* model with/without constrained parameters (this might be useful, 
    38    for example, if you have measured the same sample at different contrasts) 
     36*  in *Simultaneous* fit mode - multiple data sets are fitted simultaneously to the *same* model with/without constrained parameters (this might be useful, for example, if you have measured the same sample at different contrasts) 
    3937 
    4038*  in *Batch* fit mode - multiple data sets are fitted sequentially to the *same* model (this might be useful, for example, if you have performed a kinetic or time-resolved experiment and have *lots* of data sets!) 
     
    4543----------------- 
    4644 
    47 The models in SasView are grouped into categories. By default these consist of: 
    48  
    49 *  *Cylinder* - cylindrical shapes (disc, right cylinder, cylinder with endcaps 
    50    etc) 
    51 *  *Ellipsoid* - ellipsoidal shapes (oblate,prolate, core shell, etc) 
    52 *  *Parellelepiped* - as the name implies 
    53 *  *Sphere* - sheroidal shapes (sphere, core multishell, vesicle, etc) 
    54 *  *Lamellae* - lamellar shapes (lamellar, core shell lamellar, stacked 
    55    lamellar, etc) 
     45By default, the models in SasView are grouped into five categories 
     46 
     47*  *Shapes* - models describing 'objects' (spheres, cylinders, etc) 
    5648*  *Shape-Independent* - models describing structure in terms of density correlation functions, fractals, peaks, power laws, etc 
    57 *  *Paracrystal* - semi ordered structures (bcc, fcc, etc) 
     49*  *Customized Models* - SasView- or User-created (non-library) Python models 
     50*  *Uncategorised* - other models (for reflectivity, etc) 
    5851*  *Structure Factor* - S(Q) models 
    59 *  *Plugin Models* - User-created (custom/non-library) Python models 
    6052 
    6153Use the *Category* drop-down menu to chose a category of model, then select 
     
    9284.. image:: cat_fig0.bmp 
    9385 
    94 The categorization of all models except the user supplied Plugin Models can be 
    95 reassigned, added to, and removed using *Category Manager*. Models can also be 
    96 hidden from view in the drop-down menus. 
     86The categorization of all models except the customized models can be reassigned, 
     87added to, and removed using *Category Manager*. Models can also be hidden from view 
     88in the drop-down menus. 
    9789 
    9890.. image:: cat_fig1.bmp 
     
    10193^^^^^^^^^^^^^^^^^ 
    10294 
    103 To change category, highlight a model in the list by left-clicking on its entry 
    104 and then click the *Modify* button. Use the *Change Category* panel that appears 
    105 to make the required changes. 
     95To change category, highlight a model in the list by left-clicking on its entry and 
     96then click the *Modify* button. Use the *Change Category* panel that appears to make 
     97the required changes. 
    10698 
    10799.. image:: cat_fig2.bmp 
     
    114106^^^^^^^^^^^^^^^^^^^^^ 
    115107 
    116 Use the *Enable All / Disable All* buttons and the check boxes beside each model 
    117 to select the models to show/hide. To apply the selection, click *Ok*. Otherwise 
    118 click *Cancel*. 
     108Use the *Enable All / Disable All* buttons and the check boxes beside each model to 
     109select the models to show/hide. To apply the selection, click *Ok*. Otherwise click 
     110*Cancel*. 
    119111 
    120112*NB: It may be necessary to change to a different category and then back again* 
     
    126118--------------- 
    127119 
    128 For a complete list of all the library models available in SasView, see 
    129 the `Model Documentation <../../../index.html>`_ . 
     120For a complete list of all the library models available in SasView, see the `Model Documentation <../../../index.html>`_ . 
    130121 
    131122It is also possible to add your own models. 
     
    140131There are essentially three ways to generate new fitting models for SasView: 
    141132 
    142 *  Using the SasView :ref:`New_Plugin_Model` helper dialog (best for beginners 
    143    and/or relatively simple models) 
    144 *  By copying/editing an existing model (this can include models generated by 
    145    the New Plugin Model* dialog) in the :ref:`Python_shell` or  
    146    :ref:`Advanced_Plugin_Editor` (suitable for all use cases) 
    147 *  By writing a model from scratch outside of SasView (only recommended for code 
    148    monkeys!) 
     133* Using the SasView :ref:`New_Plugin_Model` helper dialog (best for beginners and/or relatively simple models) 
     134* By copying/editing an existing model (this can include models generated by the *New Plugin Model* dialog) in the :ref:`Python_shell` or :ref:`Advanced_Plugin_Editor` (suitable for all use cases) 
     135* By writing a model from scratch outside of SasView (only recommended for code monkeys!) 
    149136 
    150137Please read the guidance on :ref:`Writing_a_Plugin` before proceeding. 
     
    176163^^^^^^^^^^^^^^^^ 
    177164 
    178 Relatively straightforward models can be programmed directly from the SasView 
    179 GUI using the *New Plugin Model Function*. 
     165Relatively straightforward models can be programmed directly from the SasView GUI  
     166using the *New Plugin Model Function*. 
    180167 
    181168.. image:: new_model.bmp 
     
    188175*checked*\ . 
    189176 
    190 Also note that the 'Fit Parameters' have been split into two sections: those 
    191 which can be polydisperse (shape and orientation parameters) and those which are 
    192 not (eg, scattering length densities). 
     177Also note that the 'Fit Parameters' have been split into two sections: those which  
     178can be polydisperse (shape and orientation parameters) and those which are not 
     179(eg, scattering length densities). 
    193180 
    194181A model file generated by this option can be viewed and further modified using 
     
    200187.. image:: sum_model.bmp 
    201188 
    202 This option creates a custom Plugin Model of the form:: 
    203  
    204      Plugin Model = scale_factor * {(scale_1 * model_1) +/- (scale_2 * model_2)} + background 
     189This option creates a custom model of the form:: 
     190 
     191     Custom Model = scale_factor \* {(scale_1 \* model_1) \+ (scale_2 \* model_2)} \+ background 
    205192 
    206193or:: 
    207194 
    208      Plugin Model = scale_factor * model_1 /* model_2 + background 
     195     Custom Model = scale_factor \* model_1 \* model_2 \+ background 
    209196 
    210197In the *Easy Sum/Multi Editor* give the new model a function name and brief 
     
    245232Simply highlight the plugin model to be removed. The operation is final!!! 
    246233 
    247 *NB: Models shipped with SasView cannot be removed in this way.* 
     234*NB: Plugin models shipped with SasView cannot be removed in this way.* 
    248235 
    249236Load Plugin Models 
    250237^^^^^^^^^^^^^^^^^^ 
    251238 
    252 This option loads (or re-loads) all models present in the 
    253 *~\\.sasview\\plugin_models* folder. 
     239This option loads (or re-loads) all models present in the *~\\.sasview\\plugin_models* folder. 
    254240 
    255241.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     
    414400:ref:`Assessing_Fit_Quality`. 
    415401 
    416 *NB: If you need to use a custom Plugin Model, you must ensure that model is 
    417 available first (see* :ref:`Adding_your_own_models` *).* 
     402*NB: If you need to use a customized model, you must ensure that model is available* 
     403*first (see* :ref:`Adding_your_own_models` *).* 
    418404 
    419405Method 
     
    498484If multiple data sets are in one file, load just that file. *Unselect All Data*, then 
    499485select a single initial data set to be fitted. Fit that selected data set as described 
    500 above under :ref:`Single_Fit_Mode`. 
    501  
    502 *NB: If you need to use a custom Plugin Model, you must ensure that model is 
    503 available first (see* :ref:`Adding_your_own_models` *).* 
     486above under :ref:`Single_Fit_Mode` . 
     487 
     488*NB: If you need to use a customized model, you must ensure that model is available* 
     489*first (see* :ref:`Adding_your_own_models` *).* 
    504490 
    505491Method 
  • src/sas/sasgui/perspectives/fitting/media/plugin.rst

    r5295cf5 rca6cbc1c  
    2727 
    2828the next time SasView is started it will compile the plugin and add 
    29 it to the list of *Plugin Models* in a FitPage. 
     29it to the list of *Customized Models* in a FitPage. 
    3030 
    3131SasView models can be of three types: 
Note: See TracChangeset for help on using the changeset viewer.