Changeset aff7904 in sasview


Ignore:
Timestamp:
Apr 28, 2016 7:38:05 AM (9 years ago)
Author:
wojciech
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.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
3371d81
Parents:
5881b17 (diff), 259aaa0 (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:

Conflicts fixed, merged with master

Files:
1 added
26 edited

Legend:

Unmodified
Added
Removed
  • build_tools/conda/bumps/meta.yaml

    rb75079b r243fbc0  
    11package: 
    22  name: bumps 
    3   version: !!str 0.7.5.4 
     3  version: !!str 0.7.5.9 
    44 
    55source: 
    6   fn: bumps-0.7.5.4.tar.gz 
    7   url: https://pypi.python.org/packages/source/b/bumps/bumps-0.7.5.4.tar.gz 
     6  fn: bumps-0.7.5.9.tar.gz 
     7  url: https://pypi.python.org/packages/source/b/bumps/bumps-0.7.5.9.tar.gz 
    88  md5: a47c035fbb18afa5ca53067506a5ff1c 
    99#  patches: 
  • build_tools/jenkins_linux_build.sh

    r9d5427f r243fbc0  
    1515rm -rf build 
    1616 
    17 "$EASY_INSTALL" -d "$WORKSPACE/utils" bumps==0.7.5.6 
     17"$EASY_INSTALL" -d "$WORKSPACE/utils" bumps==0.7.5.9 
    1818"$EASY_INSTALL" -d "$WORKSPACE/utils" periodictable==1.3.0 
    1919 
  • build_tools/jenkins_linux_build_ver02.sh

    r22c1f1c r243fbc0  
    2727 
    2828 
    29 "$EASY_INSTALL" -d "$WORKSPACE/sasview/utils" bumps==0.7.5.6 
     29"$EASY_INSTALL" -d "$WORKSPACE/sasview/utils" bumps==0.7.5.9 
    3030"$EASY_INSTALL" -d "$WORKSPACE/sasview/utils" periodictable==1.3.0 
    3131 
  • build_tools/jenkins_osx_build.sh

    r5881b17 raff7904  
    5555cd sasview 
    5656$PYTHON setup.py clean 
    57 $PYTHON setup.py build 
    58 #$PYTHON setup.py docs 
     57$PYTHON setup.py build docs bdist_egg 
    5958 
    6059 
    61 # SASVIEW BUILD_egg with new docs 
     60# INSTALL SASVIEW 
    6261cd $WORKSPACE 
    6362cd sasview 
    64 $PYTHON setup.py docs bdist_egg 
    6563cd dist 
    6664$EASY_INSTALL -d $WORKSPACE/sasview/sasview-install sasview*.egg 
     65 
    6766 
    6867# TEST 
     
    7271#$PYTHON utest_sasview.py 
    7372 
    74 ## PYLINT 
    75 #cd $WORKSPACE 
    76 #cd sasview 
    77 #$PYLINT --rcfile "build_tools/pylint.rc" -f parseable sasview-install/sasview*.egg/sas sasview | tee  test/sasview.txt 
    78  
     73# PYLINT 
     74cd $WORKSPACE 
     75cd sasview 
     76$PYLINT --rcfile "build_tools/pylint.rc" -f parseable sasview-install/sasview*.egg/sas sasview | tee  test/sasview.txt 
    7977 
    8078# BUILD APP 
    81 #cd $WORKSPACE 
    82 #cd sasview/sasview 
    83 #$PYTHON setup_mac.py py2app 
     79cd $WORKSPACE 
     80cd sasview/sasview 
     81$PYTHON setup_mac.py py2app 
    8482 
  • build_tools/jenkins_rhel6_build.sh

    r9d5427f r243fbc0  
    2828"$EASY_INSTALL" -d "$WORKSPACE/utils" lxml 
    2929"$EASY_INSTALL" -d "$WORKSPACE/utils" pyparsing==1.5.5 
    30 "$EASY_INSTALL" -d "$WORKSPACE/utils" bumps==0.7.5.6 
     30"$EASY_INSTALL" -d "$WORKSPACE/utils" bumps==0.7.5.9 
    3131"$EASY_INSTALL" -d "$WORKSPACE/utils" periodictable==1.3.0 
    3232python deps.py 
  • build_tools/jenkins_win32_build.bat

    r9d5427f r243fbc0  
    1616RD /S /Q build 
    1717 
    18 rem %PYTHON% -m pip install -t ../sasview-install --no-deps bumps=0.7.5.6 
     18rem %PYTHON% -m pip install -t ../sasview-install --no-deps bumps=0.7.5.9 
    1919rem PYTHON% -m pip install -t ../sasview-install --no-deps periodictable=1.3.0 
    2020rem %PYTHON% -m pip install -t ../sasview-install --no-deps pyparsing=1.5.5 
  • build_tools/jenkins_win32_py27_build.bat

    r9d5427f r243fbc0  
    1616RD /S /Q build 
    1717 
    18 rem %PYTHON% -m pip install -t ../sansview-install --no-deps bumps=0.7.5.6 
     18rem %PYTHON% -m pip install -t ../sansview-install --no-deps bumps=0.7.5.9 
    1919rem PYTHON% -m pip install -t ../sansview-install --no-deps periodictable=1.3.0 
    2020rem %PYTHON% -m pip install -t ../sansview-install --no-deps pyparsing=1.5.5 
  • build_tools/requirements.txt

    ra985c93 r243fbc0  
    99PIL==1.1.7 
    1010periodictable==1.3.0 
    11 bumps==0.7.5.5 
     11bumps==0.7.5.9 
    1212# numpy==1.6.1 
    1313# scipy==0.10.1 
  • check_packages.py

    r8e7044c r243fbc0  
    1919    'pylint':{'version':None,'import_name':'pylint','test':None}, 
    2020    'periodictable':{'version':'1.3.0','import_name':'periodictable','test':'__version__'}, 
    21     'bumps':{'version':'0.7.5.7','import_name':'bumps','test':'__version__'}, 
     21    'bumps':{'version':'0.7.5.9','import_name':'bumps','test':'__version__'}, 
    2222    'numpy':{'version':'1.6.1','import_name':'numpy','test':'__version__'}, 
    2323    'scipy':{'version':'0.10.1','import_name':'scipy','test':'__version__'}, 
  • sasview/README.txt

    r792e6be r243fbc0  
    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 
     
    306343            - unittest-xml-reporting 1.12.0 (MAC 1.10.0) 
    307344            - matplotlib Version Installed: 1.4.3 (MAC 1.1.1) 
    308             - bumps Version Installed: 0.7.5.6 
     345            - bumps Version Installed: 0.7.5.9 
    309346            - scipy Version Installed: 0.16.0b2 (MAC 0.11.0) 
    310347            - periodictable Version Installed: 1.4.1 
  • 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]]} 
  • sasview/setup_exe.py

    r40fc798 ra7c4ad2  
    256256data_files += guiframe.data_files() 
    257257 
    258 import sas.models as models 
     258#import sas.models as models 
     259import sasmodels.models as models 
    259260data_files += models.data_files() 
    260261 
     
    338339packages = [ 
    339340    'matplotlib', 'scipy', 'encodings', 'comtypes', 
    340     'win32com', 'xhtml2pdf', 'bumps', 
     341    'win32com', 'xhtml2pdf', 'bumps','sasmodels', 'sas', 
    341342    ] 
    342343packages.extend([ 
  • sasview/setup_mac.py

    r5881b17 raff7904  
    4343import sas.sasgui.perspectives.invariant as invariant 
    4444DATA_FILES += invariant.data_files() 
    45 #import sas.models as models 
    4645import sasmodels.models as models 
    4746DATA_FILES += models.data_files() 
  • setup.py

    r5881b17 raff7904  
    249249 
    250250package_dir["sas.sasgui.perspectives.fitting"] = os.path.join("src", "sas", "sasgui", "perspectives", "fitting") 
    251 packages.extend(["sas.sasgui.perspectives.fitting"]) 
    252 package_data['sas.sasgui.perspectives.fitting'] = ['media/*'] 
     251package_dir["sas.sasgui.perspectives.fitting.plugin_models"] = os.path.join("src", "sas", "sasgui", "perspectives", "fitting", "plugin_models") 
     252packages.extend(["sas.sasgui.perspectives.fitting", "sas.sasgui.perspectives.fitting.plugin_models"]) 
     253package_data['sas.sasgui.perspectives.fitting'] = ['media/*', 'plugin_models/*'] 
    253254 
    254255packages.extend(["sas.sasgui.perspectives", "sas.sasgui.perspectives.calculator"]) 
     
    319320 
    320321required = [ 
    321     'bumps>=0.7.5.6', 'periodictable>=1.3.1', 'pyparsing<2.0.0', 
     322    'bumps>=0.7.5.9', 'periodictable>=1.3.1', 'pyparsing<2.0.0', 
    322323 
    323324    # 'lxml>=2.2.2', 
  • 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/__init__.py

    r9e531f2 ra7c4ad2  
    3939    data_files = [] 
    4040    path = os.path.dirname(__file__) 
    41     # p_path = os.path.join(path, 'plugin_models') 
    42     # for f in findall(p_path): 
    43     #     data_files.append(('plugin_models', [f])) 
     41    p_path = os.path.join(path, 'plugin_models') 
     42    for f in findall(p_path): 
     43        data_files.append(('plugin_models', [f])) 
    4444    # path = get_data_path(media="media") 
    4545    for f in findall(path): 
  • 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/fitpanel.py

    rf60251f r05228b0  
    1717import models 
    1818_BOX_WIDTH = 80 
    19  
    2019 
    2120class FitPanel(nb, PanelBase): 
     
    154153        """ 
    155154        """ 
    156         from bumps.options import FIT_CONFIG 
    157         current = FIT_CONFIG.selected_name 
    158         self.parent.SetTitle(self.window_name + " - Active Fitting Optimizer: " + current) 
    159155        pos = self.GetSelection() 
    160156        if pos != -1: 
  • src/sas/sasgui/perspectives/fitting/fitting.py

    r86b049b r243fbc0  
    5656    ON_MAC = True 
    5757 
    58  
     58import bumps.options 
     59from bumps.gui.fit_dialog import show_fit_config 
     60try: 
     61    from bumps.gui.fit_dialog import EVT_FITTER_CHANGED 
     62except ImportError: 
     63    # CRUFT: bumps 0.7.5.8 and below 
     64    EVT_FITTER_CHANGED = None  # type: wx.PyCommandEvent 
    5965 
    6066class Plugin(PluginBase): 
     
    501507        self.parent.Bind(EVT_SLICER_PANEL, self._on_slicer_event) 
    502508        self.parent.Bind(EVT_SLICER_PARS_UPDATE, self._onEVT_SLICER_PANEL) 
     509 
     510        # CRUFT: EVT_FITTER_CHANGED is not None for bumps 0.7.5.9 and above 
     511        if EVT_FITTER_CHANGED is not None: 
     512            self.parent.Bind(EVT_FITTER_CHANGED, self.on_fitter_changed) 
     513        self._set_fitter_label(bumps.options.FIT_CONFIG) 
     514 
    503515        #self.parent._mgr.Bind(wx.aui.EVT_AUI_PANE_CLOSE,self._onclearslicer) 
    504516        #Create reader when fitting panel are created 
     
    763775        Open the bumps options panel. 
    764776        """ 
    765         try: 
    766             from bumps.gui.fit_dialog import show_fit_config 
    767             show_fit_config(self.parent, help=self.on_help) 
    768         except ImportError: 
    769             # CRUFT: Bumps 0.7.5.6 and earlier do not have the help button 
    770             from bumps.gui.fit_dialog import OpenFitOptions 
    771             OpenFitOptions() 
     777        show_fit_config(self.parent, help=self.on_help) 
     778 
     779    def on_fitter_changed(self, event): 
     780        self._set_fitter_label(event.config) 
     781 
     782    def _set_fitter_label(self, config): 
     783        self.fit_panel.parent.SetTitle(self.fit_panel.window_name 
     784                                       + " - Active Fitting Optimizer: " 
     785                                       + config.selected_name) 
    772786 
    773787    def on_help(self, algorithm_id): 
  • src/sas/sasgui/perspectives/fitting/models.py

    rdcdca68 rcb4ef58  
    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.