- Timestamp:
- Feb 25, 2017 1:33:43 PM (8 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.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. - Location:
- src/sas
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/dataloader/readers/sesans_reader.py
r345e7e4 r9525358 166 166 output.dlam, output.dlam_unit = self._unit_conversion(dlam, lam_unit, default_z_unit) 167 167 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) 170 170 # Store loading process information 171 171 output.meta_data['loader'] = self.type_name … … 175 175 zaccept_unit_split = paramnames[7].split("[") 176 176 zaccept_unit = zaccept_unit_split[1].replace("]","") 177 if zaccept_unit.strip() == '\AA^-1':177 if zaccept_unit.strip() == r'\AA^-1': 178 178 zaccept_unit = "1/A" 179 179 output.sample.zacceptance=(float(paramvals[7]),zaccept_unit) -
src/sas/sasgui/perspectives/fitting/fitpage.py
r4387385 ref2cdb3 362 362 self.Bind(wx.EVT_RADIOBUTTON, self.onSlitSmear, 363 363 id=self.slit_smearer.GetId()) 364 self. enable_smearer.SetValue(True)364 self.disable_smearer.SetValue(True) 365 365 366 366 sizer_smearer.Add(self.disable_smearer, 0, wx.LEFT, 10) … … 1934 1934 1935 1935 # more disables for 2D 1936 di_flag = False 1937 dq_flag = False 1936 1938 if self.data.__class__.__name__ == "Data2D" or \ 1937 1939 self.enable2D: … … 1939 1941 self.pinhole_smearer.Enable(True) 1940 1942 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 1951 1949 else: 1952 1950 self.slit_smearer.Enable(True) 1953 1951 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 1965 1977 # Enable weighting radio buttons 1966 1978 self.dI_noweight.Enable(True) … … 2004 2016 self.EditMask_title.Disable() 2005 2017 2018 self.onSmear(event=None) 2006 2019 self.on_set_focus(None) 2007 2020 self.Refresh() -
src/sas/sasgui/perspectives/fitting/basepage.py
ra6fccd7 r4387385 53 53 ON_MAC = True 54 54 55 CUSTOM_MODEL = 'Plugin Models' 56 CUSTOM_MODEL_OLD = 'Customized Models' 57 55 58 class BasicPage(ScrolledPanel, PanelBase): 56 59 """ 57 This class provide general structure of fitpanel page60 This class provide general structure of the fitpanel page 58 61 """ 59 62 # Internal name for the AUI manager … … 677 680 def _copy_info(self, flag): 678 681 """ 679 Send event d pemding on flag680 681 : Param flag: flag that distinguish event682 Send event depending on flag 683 684 : Param flag: flag that distinguishes the event 682 685 """ 683 686 # messages depending on the flag … … 1119 1122 :precondition: the page is already drawn or created 1120 1123 1121 :postcondition: the state of the underlying data change as well as the1124 :postcondition: the state of the underlying data changes as well as the 1122 1125 state of the graphic interface 1123 1126 """ … … 1156 1159 # select the current model 1157 1160 state._convert_to_sasmodels() 1161 if state.categorycombobox == CUSTOM_MODEL_OLD: 1162 state.categorycombobox = CUSTOM_MODEL 1158 1163 state.categorycombobox = unicode(state.categorycombobox) 1159 1164 if state.categorycombobox in self.categorybox.Items: … … 1167 1172 self._show_combox(None) 1168 1173 from models import PLUGIN_NAME_BASE 1169 if self.categorybox.GetValue() == 'Customized Models'\1174 if self.categorybox.GetValue() == CUSTOM_MODEL \ 1170 1175 and PLUGIN_NAME_BASE not in state.formfactorcombobox: 1171 1176 state.formfactorcombobox = \ … … 1335 1340 def _selectDlg(self): 1336 1341 """ 1337 open a dialog file to select ed the customized dispersity1342 open a dialog file to select the customized polydispersity function 1338 1343 """ 1339 1344 if self.parent is not None: … … 1760 1765 def _set_multfactor_combobox(self, multiplicity=10): 1761 1766 """ 1762 Set comboBox for mu itfactor of CoreMultiShellModel1767 Set comboBox for multitfactor of CoreMultiShellModel 1763 1768 :param multiplicit: no. of multi-functionality 1764 1769 """ … … 1798 1803 Fill panel's combo box according to the type of model selected 1799 1804 """ 1800 custom_model = 'Customized Models' 1805 1801 1806 mod_cat = self.categorybox.GetStringSelection() 1802 1807 self.structurebox.SetSelection(0) … … 1807 1812 m_list = [] 1808 1813 try: 1809 if mod_cat == custom_model:1814 if mod_cat == CUSTOM_MODEL: 1810 1815 for model in self.model_list_box[mod_cat]: 1811 1816 m_list.append(self.model_dict[model.name]) … … 3453 3458 fills out the category list box 3454 3459 """ 3455 uncat_str = ' CustomizedModels'3460 uncat_str = 'Plugin Models' 3456 3461 self._read_category_info() 3457 3462 … … 3482 3487 self.model_box.Clear() 3483 3488 3484 if category == ' CustomizedModels':3489 if category == 'Plugin Models': 3485 3490 for model in self.model_list_box[category]: 3486 3491 str_m = str(model).split(".")[0] -
src/sas/sasgui/perspectives/fitting/fitting.py
r73cbeec re92a352 225 225 226 226 self.id_edit = wx.NewId() 227 editmodel_help = "Edit customized model sample file"228 227 self.menu1.AppendMenu(self.id_edit, "Plugin Model Operations", 229 self.edit_model_menu , editmodel_help)228 self.edit_model_menu) 230 229 #create menubar items 231 230 return [(self.menu1, self.sub_menu)] … … 260 259 self.update_custom_combo() 261 260 if os.path.isfile(p_path): 262 msg = "Sorry! Could not beable to delete the default "263 msg += " custommodel... \n"261 msg = "Sorry! unable to delete the default " 262 msg += "plugin model... \n" 264 263 msg += "Please manually remove the files (.py, .pyc) " 265 264 msg += "in the 'plugin_models' folder \n" … … 274 273 if item.GetLabel() == label: 275 274 self.edit_menu.DeleteItem(item) 276 msg = "The custommodel, %s, has been deleted." % label275 msg = "The plugin model, %s, has been deleted." % label 277 276 evt = StatusEvent(status=msg, type='stop', info='info') 278 277 wx.PostEvent(self.parent, evt) … … 331 330 temp = self.fit_panel.reset_pmodel_list() 332 331 if temp: 333 # Set the new custommodel list for all fit pages332 # Set the new plugin model list for all fit pages 334 333 for uid, page in self.fit_panel.opened_pages.iteritems(): 335 334 if hasattr(page, "formfactorbox"): -
src/sas/sasgui/perspectives/fitting/models.py
r0de74af r11b094f 325 325 self.plugins.append(plug) 326 326 self.model_dictionary[name] = plug 327 self.model_combobox.set_list(" CustomizedModels", self.plugins)327 self.model_combobox.set_list("Plugin Models", self.plugins) 328 328 return self.model_combobox.get_list() 329 329 else: … … 346 346 self.model_dictionary[name] = plug 347 347 348 self.model_combobox.reset_list(" CustomizedModels", self.plugins)348 self.model_combobox.reset_list("Plugin Models", self.plugins) 349 349 return self.model_combobox.get_list() 350 350 … … 389 389 # self.shape_indep_list) 390 390 self.model_combobox.set_list("Structure Factors", self.struct_list) 391 self.model_combobox.set_list(" CustomizedModels", self.plugins)391 self.model_combobox.set_list("Plugin Models", self.plugins) 392 392 self.model_combobox.set_list("P(Q)*S(Q)", self.multiplication_factor) 393 393 self.model_combobox.set_list("multiplication", -
src/sas/sasgui/perspectives/fitting/pagestate.py
r6d2b50b r4387385 33 33 from sas.sascalc.dataloader.data_info import Data2D, Collimation, Detector 34 34 from sas.sascalc.dataloader.data_info import Process, Aperture 35 35 36 # Information to read/write state as xml 36 37 FITTING_NODE_NAME = 'fitting_plug_in' 37 38 CANSAS_NS = "cansas1d/1.0" 39 40 CUSTOM_MODEL = 'Plugin Models' 41 CUSTOM_MODEL_OLD = 'Customized Models' 38 42 39 43 LIST_OF_DATA_ATTRIBUTES = [["is_data", "is_data", "bool"], … … 378 382 'Sphere' : 'adsorbed_layer', 379 383 'Structure Factor' : 'hardsphere', 380 'Customized Models' : '' 384 CUSTOM_MODEL_OLD : '', 385 CUSTOM_MODEL : '' 381 386 } 382 387 if self.categorycombobox == '':
Note: See TracChangeset
for help on using the changeset viewer.