Changeset ef2cdb3 in sasview


Ignore:
Timestamp:
Feb 25, 2017 1:33:43 PM (7 years ago)
Author:
butler
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, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
5295cf5
Parents:
4387385 (diff), cb05bfd (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 remote-tracking branch 'origin/master' into ticket-756

Files:
7 edited

Legend:

Unmodified
Added
Removed
  • setup.py

    r18e7309 r1e13b53  
    206206) 
    207207 
    208  
    209208# sas.sascalc.pr 
    210209srcdir  = os.path.join("src", "sas", "sascalc", "pr", "c_extensions") 
     
    229228                              ) ) 
    230229 
     230#sas.sascalc.corfunc 
     231package_dir["sas.sascalc.corfunc"] = os.path.join("src", "sas", "sascalc", "corfunc") 
     232packages.extend(["sas.sascalc.corfunc"]) 
     233 
    231234# sas.sascalc.fit 
    232235package_dir["sas.sascalc.fit"] = os.path.join("src", "sas", "sascalc", "fit") 
     
    237240package_dir["sas.sasgui.perspectives.pr"] = os.path.join("src", "sas", "sasgui", "perspectives", "pr") 
    238241packages.extend(["sas.sasgui.perspectives","sas.sasgui.perspectives.pr"]) 
    239 package_data["sas.sasgui.perspectives.pr"] = ['images/*'] 
     242package_data["sas.sasgui.perspectives.pr"] = ['media/*'] 
    240243 
    241244package_dir["sas.sasgui.perspectives.invariant"] = os.path.join("src", "sas", "sasgui", "perspectives", "invariant") 
     
    250253packages.extend(["sas.sasgui.perspectives", "sas.sasgui.perspectives.calculator"]) 
    251254package_data['sas.sasgui.perspectives.calculator'] = ['images/*', 'media/*'] 
     255 
     256package_dir["sas.sasgui.perspectives.corfunc"] = os.path.join("src", "sas", "sasgui", "perspectives", "corfunc") 
     257packages.extend(["sas.sasgui.perspectives.corfunc"]) 
     258package_data['sas.sasgui.perspectives.corfunc'] = ['media/*'] 
     259 
     260package_dir["sas.sasgui.perspectives.file_converter"] = os.path.join("src", "sas", "sasgui", "perspectives", "file_converter") 
     261packages.extend(["sas.sasgui.perspectives.file_converter"]) 
     262package_data['sas.sasgui.perspectives.file_converter'] = ['media/*'] 
    252263 
    253264# Data util 
  • src/sas/sascalc/dataloader/readers/sesans_reader.py

    r345e7e4 r9525358  
    166166                output.dlam, output.dlam_unit = self._unit_conversion(dlam, lam_unit, default_z_unit) 
    167167 
    168                 output.xaxis("\rm{z}", output.x_unit) 
    169                 output.yaxis("\\rm{P/P0}", output.y_unit) 
     168                output.xaxis(r"\rm{z}", output.x_unit) 
     169                output.yaxis(r"\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() == '\AA^-1': 
     177                if zaccept_unit.strip() == r'\AA^-1': 
    178178                    zaccept_unit = "1/A" 
    179179                output.sample.zacceptance=(float(paramvals[7]),zaccept_unit) 
  • src/sas/sasgui/perspectives/fitting/fitpage.py

    r4387385 ref2cdb3  
    362362        self.Bind(wx.EVT_RADIOBUTTON, self.onSlitSmear, 
    363363                  id=self.slit_smearer.GetId()) 
    364         self.enable_smearer.SetValue(True) 
     364        self.disable_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 
    19361938            if self.data.__class__.__name__ == "Data2D" or \ 
    19371939                        self.enable2D: 
     
    19391941                self.pinhole_smearer.Enable(True) 
    19401942                self.default_mask = copy.deepcopy(self.data.mask) 
    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() 
     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 
    19511949            else: 
    19521950                self.slit_smearer.Enable(True) 
    19531951                self.pinhole_smearer.Enable(True) 
    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() 
     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 
    19651977            # Enable weighting radio buttons 
    19661978            self.dI_noweight.Enable(True) 
     
    20042016            self.EditMask_title.Disable() 
    20052017 
     2018        self.onSmear(event=None) 
    20062019        self.on_set_focus(None) 
    20072020        self.Refresh() 
  • src/sas/sasgui/perspectives/fitting/basepage.py

    ra6fccd7 r4387385  
    5353    ON_MAC = True 
    5454 
     55CUSTOM_MODEL = 'Plugin Models' 
     56CUSTOM_MODEL_OLD = 'Customized Models' 
     57 
    5558class BasicPage(ScrolledPanel, PanelBase): 
    5659    """ 
    57     This class provide general structure of fitpanel page 
     60    This class provide general structure of the fitpanel page 
    5861    """ 
    5962    # Internal name for the AUI manager 
     
    677680    def _copy_info(self, flag): 
    678681        """ 
    679         Send event dpemding on flag 
    680  
    681         : Param flag: flag that distinguish event 
     682        Send event depending on flag 
     683 
     684        : Param flag: flag that distinguishes the event 
    682685        """ 
    683686        # messages depending on the flag 
     
    11191122        :precondition: the page is already drawn or created 
    11201123 
    1121         :postcondition: the state of the underlying data change as well as the 
     1124        :postcondition: the state of the underlying data changes as well as the 
    11221125            state of the graphic interface 
    11231126        """ 
     
    11561159        # select the current model 
    11571160        state._convert_to_sasmodels() 
     1161        if state.categorycombobox == CUSTOM_MODEL_OLD: 
     1162            state.categorycombobox = CUSTOM_MODEL 
    11581163        state.categorycombobox = unicode(state.categorycombobox) 
    11591164        if state.categorycombobox in self.categorybox.Items: 
     
    11671172        self._show_combox(None) 
    11681173        from models import PLUGIN_NAME_BASE 
    1169         if self.categorybox.GetValue() == 'Customized Models' \ 
     1174        if self.categorybox.GetValue() == CUSTOM_MODEL \ 
    11701175                and PLUGIN_NAME_BASE not in state.formfactorcombobox: 
    11711176            state.formfactorcombobox = \ 
     
    13351340    def _selectDlg(self): 
    13361341        """ 
    1337         open a dialog file to selected the customized dispersity 
     1342        open a dialog file to select the customized polydispersity function 
    13381343        """ 
    13391344        if self.parent is not None: 
     
    17601765    def _set_multfactor_combobox(self, multiplicity=10): 
    17611766        """ 
    1762         Set comboBox for muitfactor of CoreMultiShellModel 
     1767        Set comboBox for multitfactor of CoreMultiShellModel 
    17631768        :param multiplicit: no. of multi-functionality 
    17641769        """ 
     
    17981803        Fill panel's combo box according to the type of model selected 
    17991804        """ 
    1800         custom_model = 'Customized Models' 
     1805 
    18011806        mod_cat = self.categorybox.GetStringSelection() 
    18021807        self.structurebox.SetSelection(0) 
     
    18071812        m_list = [] 
    18081813        try: 
    1809             if mod_cat == custom_model: 
     1814            if mod_cat == CUSTOM_MODEL: 
    18101815                for model in self.model_list_box[mod_cat]: 
    18111816                    m_list.append(self.model_dict[model.name]) 
     
    34533458        fills out the category list box 
    34543459        """ 
    3455         uncat_str = 'Customized Models' 
     3460        uncat_str = 'Plugin Models' 
    34563461        self._read_category_info() 
    34573462 
     
    34823487        self.model_box.Clear() 
    34833488 
    3484         if category == 'Customized Models': 
     3489        if category == 'Plugin Models': 
    34853490            for model in self.model_list_box[category]: 
    34863491                str_m = str(model).split(".")[0] 
  • src/sas/sasgui/perspectives/fitting/fitting.py

    r73cbeec re92a352  
    225225 
    226226        self.id_edit = wx.NewId() 
    227         editmodel_help = "Edit customized model sample file" 
    228227        self.menu1.AppendMenu(self.id_edit, "Plugin Model Operations", 
    229                               self.edit_model_menu, editmodel_help) 
     228                              self.edit_model_menu) 
    230229        #create  menubar items 
    231230        return [(self.menu1, self.sub_menu)] 
     
    260259            self.update_custom_combo() 
    261260            if os.path.isfile(p_path): 
    262                 msg = "Sorry! Could not be able to delete the default " 
    263                 msg += "custom model... \n" 
     261                msg = "Sorry! unable to delete the default " 
     262                msg += "plugin model... \n" 
    264263                msg += "Please manually remove the files (.py, .pyc) " 
    265264                msg += "in the 'plugin_models' folder \n" 
     
    274273                    if item.GetLabel() == label: 
    275274                        self.edit_menu.DeleteItem(item) 
    276                         msg = "The custom model, %s, has been deleted." % label 
     275                        msg = "The plugin model, %s, has been deleted." % label 
    277276                        evt = StatusEvent(status=msg, type='stop', info='info') 
    278277                        wx.PostEvent(self.parent, evt) 
     
    331330            temp = self.fit_panel.reset_pmodel_list() 
    332331            if temp: 
    333                 # Set the new custom model list for all fit pages 
     332                # Set the new plugin model list for all fit pages 
    334333                for uid, page in self.fit_panel.opened_pages.iteritems(): 
    335334                    if hasattr(page, "formfactorbox"): 
  • src/sas/sasgui/perspectives/fitting/models.py

    r0de74af r11b094f  
    325325                    self.plugins.append(plug) 
    326326                    self.model_dictionary[name] = plug 
    327             self.model_combobox.set_list("Customized Models", self.plugins) 
     327            self.model_combobox.set_list("Plugin Models", self.plugins) 
    328328            return self.model_combobox.get_list() 
    329329        else: 
     
    346346            self.model_dictionary[name] = plug 
    347347 
    348         self.model_combobox.reset_list("Customized Models", self.plugins) 
     348        self.model_combobox.reset_list("Plugin Models", self.plugins) 
    349349        return self.model_combobox.get_list() 
    350350 
     
    389389#                                     self.shape_indep_list) 
    390390        self.model_combobox.set_list("Structure Factors", self.struct_list) 
    391         self.model_combobox.set_list("Customized Models", self.plugins) 
     391        self.model_combobox.set_list("Plugin Models", self.plugins) 
    392392        self.model_combobox.set_list("P(Q)*S(Q)", self.multiplication_factor) 
    393393        self.model_combobox.set_list("multiplication", 
  • src/sas/sasgui/perspectives/fitting/pagestate.py

    r6d2b50b r4387385  
    3333from sas.sascalc.dataloader.data_info import Data2D, Collimation, Detector 
    3434from sas.sascalc.dataloader.data_info import Process, Aperture 
     35 
    3536# Information to read/write state as xml 
    3637FITTING_NODE_NAME = 'fitting_plug_in' 
    3738CANSAS_NS = "cansas1d/1.0" 
     39 
     40CUSTOM_MODEL = 'Plugin Models' 
     41CUSTOM_MODEL_OLD = 'Customized Models' 
    3842 
    3943LIST_OF_DATA_ATTRIBUTES = [["is_data", "is_data", "bool"], 
     
    378382                'Sphere' : 'adsorbed_layer', 
    379383                'Structure Factor' : 'hardsphere', 
    380                 'Customized Models' : '' 
     384                CUSTOM_MODEL_OLD : '', 
     385                CUSTOM_MODEL : '' 
    381386            } 
    382387            if self.categorycombobox == '': 
Note: See TracChangeset for help on using the changeset viewer.