Changeset b3e8629 in sasview for src/sas/qtgui/Perspectives
- Timestamp:
- Nov 9, 2017 8:41:54 AM (7 years ago)
- Branches:
- 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
- Children:
- cee5c78
- Parents:
- 749b715
- git-author:
- Piotr Rozyczko <rozyczko@…> (10/26/17 03:13:05)
- git-committer:
- Piotr Rozyczko <rozyczko@…> (11/09/17 08:41:54)
- Location:
- src/sas/qtgui/Perspectives
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FitThread.py
ree18d33 rb3e8629 14 14 15 15 def map_apply(arguments): 16 return a pply(arguments[0],arguments[1:])16 return arguments[0](*arguments[1:]) 17 17 18 18 class FitThread(CalcThread): … … 55 55 except KeyboardInterrupt: 56 56 msg = "Fitting: terminated by the user." 57 raise KeyboardInterrupt , msg57 raise KeyboardInterrupt(msg) 58 58 59 59 def compute(self): … … 71 71 list_q = [None]*fitter_size 72 72 73 inputs = zip(list_map_get_attr, self.fitter, list_fit_function,73 inputs = list(zip(list_map_get_attr, self.fitter, list_fit_function, 74 74 list_q, list_q, list_handler, list_curr_thread, 75 list_reset_flag) 76 result = map(map_apply, inputs)75 list_reset_flag)) 76 result = list(map(map_apply, inputs)) 77 77 results = (result, time.time()-self.starttime) 78 78 if self.handler: … … 81 81 return (results) 82 82 83 except KeyboardInterrupt ,msg:83 except KeyboardInterrupt as msg: 84 84 # Thread was interrupted, just proceed and re-raise. 85 85 # Real code should not print, but this is an example... -
src/sas/qtgui/Perspectives/Fitting/FittingLogic.py
ree18d33 rb3e8629 196 196 msg = "Unable to find min/max/length of \n data named %s" % \ 197 197 self.data.filename 198 raise ValueError , msg198 raise ValueError(msg) 199 199 200 200 else: … … 206 206 msg = "Unable to find min/max of \n data named %s" % \ 207 207 self.data.filename 208 raise ValueError , msg208 raise ValueError(msg) 209 209 qmax = np.sqrt(x * x + y * y) 210 210 npts = len(data.data) -
src/sas/qtgui/Perspectives/Fitting/FittingOptions.py
r377ade1 rb3e8629 80 80 Use options.FIT_FIELDS to assert which line edit gets what validator 81 81 """ 82 for option in bumps.options.FIT_FIELDS. iterkeys():82 for option in bumps.options.FIT_FIELDS.keys(): 83 83 (f_name, f_type) = bumps.options.FIT_FIELDS[option] 84 84 validator = None … … 86 86 validator = QtGui.QIntValidator() 87 87 validator.setBottom(0) 88 elif f_type == types.FloatType:88 elif f_type == float: 89 89 validator = QtGui.QDoubleValidator() 90 90 validator.setBottom(0) … … 153 153 154 154 # Update the BUMPS singleton 155 [bumpsUpdate(o) for o in self.config.values[self.current_fitter_id]. iterkeys()]155 [bumpsUpdate(o) for o in self.config.values[self.current_fitter_id].keys()] 156 156 157 157 def onHelp(self): … … 175 175 if current_fitter is None: 176 176 current_fitter = self.current_fitter_id 177 if option_id not in bumps.options.FIT_FIELDS.keys(): return None177 if option_id not in list(bumps.options.FIT_FIELDS.keys()): return None 178 178 option = option_id + '_' + current_fitter 179 179 if not hasattr(self, option): return None … … 193 193 """ 194 194 options = self.config.values[fitter_id] 195 for option in options. iterkeys():195 for option in options.keys(): 196 196 # Find the widget name of the option 197 197 # e.g. 'samples' for 'dream' is 'self.samples_dream' -
src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py
r14fa542 rb3e8629 12 12 from sas.qtgui.Perspectives.Fitting.FittingOptions import FittingOptions 13 13 from sas.qtgui.Perspectives.Fitting.GPUOptions import GPUOptions 14 from sas.qtgui.Perspectives.Fitting import ModelUtilities14 #from sas.qtgui.Perspectives.Fitting import ModelUtilities 15 15 16 16 class FittingWindow(QtGui.QTabWidget): … … 64 64 # GPU Options 65 65 self.gpu_options_widget = GPUOptions(self) 66 67 self.menu_manager = ModelUtilities.ModelManager()68 # TODO: reuse these in FittingWidget properly69 self.model_list_box = self.menu_manager.get_model_list()70 self.model_dictionary = self.menu_manager.get_model_dictionary()71 66 72 67 #self.setWindowTitle('Fit panel - Active Fitting Optimizer: %s' % self.optimizer) … … 124 119 Create a list if none exists and append if there's already a list 125 120 """ 126 if item_key in self.dataToFitTab.keys(): 127 self.dataToFitTab[item_key].append(tab_name) 121 item_key_str = str(item_key) 122 if item_key_str in list(self.dataToFitTab.keys()): 123 self.dataToFitTab[item_key_str].append(tab_name) 128 124 else: 129 self.dataToFitTab[item_key ] = [tab_name]125 self.dataToFitTab[item_key_str] = [tab_name] 130 126 131 127 #print "CURRENT dict: ", self.dataToFitTab … … 173 169 Given name of the fitting tab - close it 174 170 """ 175 for tab_index in xrange(len(self.tabs)):171 for tab_index in range(len(self.tabs)): 176 172 if self.tabText(tab_index) == tab_name: 177 173 self.tabCloses(tab_index) … … 185 181 return 186 182 for index_to_delete in index_list: 187 if index_to_delete in self.dataToFitTab.keys(): 188 for tab_name in self.dataToFitTab[index_to_delete]: 183 index_to_delete_str = str(index_to_delete) 184 if index_to_delete_str in list(self.dataToFitTab.keys()): 185 for tab_name in self.dataToFitTab[index_to_delete_str]: 189 186 # delete tab #index after corresponding data got removed 190 187 self.closeTabByName(tab_name) 191 self.dataToFitTab.pop(index_to_delete )188 self.dataToFitTab.pop(index_to_delete_str) 192 189 193 190 #print "CURRENT dict: ", self.dataToFitTab … … 209 206 if not isinstance(data_item, list): 210 207 msg = "Incorrect type passed to the Fitting Perspective" 211 raise AttributeError , msg208 raise AttributeError(msg) 212 209 213 210 if not isinstance(data_item[0], QtGui.QStandardItem): 214 211 msg = "Incorrect type passed to the Fitting Perspective" 215 raise AttributeError , msg212 raise AttributeError(msg) 216 213 217 214 items = [data_item] if is_batch else data_item … … 220 217 # Find the first unassigned tab. 221 218 # If none, open a new tab. 222 available_tabs = list( map(lambda tab: tab.acceptsData(), self.tabs))219 available_tabs = list([tab.acceptsData() for tab in self.tabs]) 223 220 224 221 if numpy.any(available_tabs): -
src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py
- Property mode changed from 100644 to 100755
rd0dfcb2 rb3e8629 44 44 Returns a list of all multi-shell parameters in 'model' 45 45 """ 46 return list( filter(lambda par: "[" in par.name, model.iq_parameters))46 return list([par for par in model.iq_parameters if "[" in par.name]) 47 47 48 48 def getMultiplicity(model): … … 156 156 """ 157 157 for i, item in enumerate(model_header_captions): 158 model.setHeaderData(i, QtCore.Qt.Horizontal, QtCore.QVariant(item)) 158 #model.setHeaderData(i, QtCore.Qt.Horizontal, QtCore.QVariant(item)) 159 model.setHeaderData(i, QtCore.Qt.Horizontal, item) 159 160 160 161 model.header_tooltips = model_header_tooltips … … 167 168 model_header_error_captions.insert(2, header_error_caption) 168 169 for i, item in enumerate(model_header_error_captions): 169 model.setHeaderData(i, QtCore.Qt.Horizontal, QtCore.QVariant(item))170 model.setHeaderData(i, QtCore.Qt.Horizontal, item) 170 171 171 172 model_header_error_tooltips = model_header_tooltips … … 178 179 """ 179 180 for i, item in enumerate(poly_header_captions): 180 model.setHeaderData(i, QtCore.Qt.Horizontal, QtCore.QVariant(item))181 model.setHeaderData(i, QtCore.Qt.Horizontal, item) 181 182 182 183 model.header_tooltips = poly_header_tooltips … … 190 191 poly_header_error_captions.insert(2, header_error_caption) 191 192 for i, item in enumerate(poly_header_error_captions): 192 model.setHeaderData(i, QtCore.Qt.Horizontal, QtCore.QVariant(item))193 model.setHeaderData(i, QtCore.Qt.Horizontal, item) 193 194 194 195 poly_header_error_tooltips = poly_header_tooltips … … 202 203 multishell_parameters = getIterParams(parameters) 203 204 204 for i in xrange(index):205 for i in range(index): 205 206 for par in multishell_parameters: 206 207 # Create the name: <param>[<i>], e.g. "sld1" for parameter "sld[n]" … … 396 397 397 398 def binary_encode(i, digits): 398 return [i >> d & 1 for d in xrange(digits)]399 return [i >> d & 1 for d in range(digits)] 399 400 400 401 def getWeight(data, is2d, flag=None): -
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
re00b76e rb3e8629 2 2 import os 3 3 from collections import defaultdict 4 from itertools import izip 4 5 5 6 6 import logging … … 70 70 if role == QtCore.Qt.ToolTipRole: 71 71 if orientation == QtCore.Qt.Horizontal: 72 return QtCore.QString(str(self.header_tooltips[section]))72 return str(self.header_tooltips[section]) 73 73 74 74 return QtGui.QStandardItemModel.headerData(self, section, orientation, role) … … 359 359 # Similarly on other tabs 360 360 self.options_widget.setEnablementOnDataLoad() 361 362 # Reload the model363 361 self.onSelectModel() 364 365 362 # Smearing tab 366 363 self.smearing_widget.updateSmearing(self.data) … … 482 479 model = str(self.cbModel.currentText()) 483 480 481 # empty combobox forced to be read 482 if not model: 483 return 484 484 # Reset structure factor 485 485 self.cbStructureFactor.setCurrentIndex(0) … … 772 772 """ 773 773 """ 774 print "UPDATE FIT"774 print("UPDATE FIT") 775 775 pass 776 776 … … 778 778 """ 779 779 """ 780 print "FIT FAILED: ", reason780 print("FIT FAILED: ", reason) 781 781 pass 782 782 … … 823 823 param_values = res.pvec # array([ 0.36221662, 0.0146783 ]) 824 824 param_stderr = res.stderr # array([ 1.71293015, 1.71294233]) 825 params_and_errors = zip(param_values, param_stderr)826 param_dict = dict( izip(param_list, params_and_errors))825 params_and_errors = list(zip(param_values, param_stderr)) 826 param_dict = dict(zip(param_list, params_and_errors)) 827 827 828 828 # Dictionary of fitted parameter: value, error … … 845 845 Take func and throw it inside the model row loop 846 846 """ 847 for row_i in xrange(self._model_model.rowCount()):847 for row_i in range(self._model_model.rowCount()): 848 848 func(row_i) 849 849 … … 860 860 # internal so can use closure for param_dict 861 861 param_name = str(self._model_model.item(row, 0).text()) 862 if param_name not in param_dict.keys():862 if param_name not in list(param_dict.keys()): 863 863 return 864 864 # modify the param value … … 872 872 # Utility function for updateof polydispersity part of the main model 873 873 param_name = str(self._model_model.item(row, 0).text())+'.width' 874 if param_name not in param_dict.keys():874 if param_name not in list(param_dict.keys()): 875 875 return 876 876 # modify the param value … … 887 887 return str(self._model_model.item(row, 0).text()) 888 888 889 [createItem(param_name) for param_name in param_dict.keys() if curr_param() == param_name]889 [createItem(param_name) for param_name in list(param_dict.keys()) if curr_param() == param_name] 890 890 891 891 error_column.append(item) … … 931 931 Take func and throw it inside the poly model row loop 932 932 """ 933 for row_i in xrange(self._poly_model.rowCount()):933 for row_i in range(self._poly_model.rowCount()): 934 934 func(row_i) 935 935 … … 940 940 return 941 941 param_name = str(self._poly_model.item(row_i, 0).text()).rsplit()[-1] + '.width' 942 if param_name not in param_dict.keys():942 if param_name not in list(param_dict.keys()): 943 943 return 944 944 # modify the param value … … 963 963 return str(self._poly_model.item(row_i, 0).text()).rsplit()[-1] + '.width' 964 964 965 [createItem(param_name) for param_name in param_dict.keys() if poly_param() == param_name]965 [createItem(param_name) for param_name in list(param_dict.keys()) if poly_param() == param_name] 966 966 967 967 error_column.append(item) … … 1000 1000 Take func and throw it inside the magnet model row loop 1001 1001 """ 1002 for row_i in xrange(self._model_model.rowCount()):1002 for row_i in range(self._model_model.rowCount()): 1003 1003 func(row_i) 1004 1004 … … 1007 1007 # internal so can use closure for param_dict 1008 1008 param_name = str(self._magnet_model.item(row, 0).text()) 1009 if param_name not in param_dict.keys():1009 if param_name not in list(param_dict.keys()): 1010 1010 return 1011 1011 # modify the param value … … 1025 1025 return str(self._magnet_model.item(row, 0).text()) 1026 1026 1027 [createItem(param_name) for param_name in param_dict.keys() if curr_param() == param_name]1027 [createItem(param_name) for param_name in list(param_dict.keys()) if curr_param() == param_name] 1028 1028 1029 1029 error_column.append(item) … … 1303 1303 # Unparsable field 1304 1304 return 1305 parameter_name = str(self._model_model.data(name_index) .toPyObject()) # sld, background etc.1305 parameter_name = str(self._model_model.data(name_index)) #.toPyObject()) # sld, background etc. 1306 1306 1307 1307 # Update the parameter value - note: this supports +/-inf as well … … 1369 1369 1370 1370 return [str(model.item(row_index, 0).text()) 1371 for row_index in xrange(model.rowCount())1371 for row_index in range(model.rowCount()) 1372 1372 if isChecked(row_index)] 1373 1373 … … 1410 1410 fitted_data.symbol = 'Line' 1411 1411 # Notify the GUI manager so it can update the main model in DataExplorer 1412 GuiUtils.updateModelItemWithPlot(self._index, QtCore.QVariant(fitted_data), name)1412 GuiUtils.updateModelItemWithPlot(self._index, fitted_data, name) 1413 1413 1414 1414 def createTheoryIndex(self, fitted_data): … … 1418 1418 name = self.nameFromData(fitted_data) 1419 1419 # Notify the GUI manager so it can create the theory model in DataExplorer 1420 new_item = GuiUtils.createModelItemWithPlot( QtCore.QVariant(fitted_data), name=name)1420 new_item = GuiUtils.createModelItemWithPlot(fitted_data, name=name) 1421 1421 self.communicate.updateTheoryFromPerspectiveSignal.emit(new_item) 1422 1422 … … 1472 1472 Thread returned error 1473 1473 """ 1474 print "Calculate Data failed with ", reason1474 print("Calculate Data failed with ", reason) 1475 1475 1476 1476 def complete1D(self, return_data): … … 1569 1569 else: 1570 1570 # Create as many entries as current shells 1571 for ishell in xrange(1, self.current_shell_displayed+1):1571 for ishell in range(1, self.current_shell_displayed+1): 1572 1572 # Remove [n] and add the shell numeral 1573 1573 name = param_name[0:param_name.index('[')] + str(ishell) … … 1597 1597 # All possible polydisp. functions as strings in combobox 1598 1598 func = QtGui.QComboBox() 1599 func.addItems([str(name_disp) for name_disp in POLYDISPERSITY_MODELS. iterkeys()])1599 func.addItems([str(name_disp) for name_disp in POLYDISPERSITY_MODELS.keys()]) 1600 1600 # Set the default index 1601 1601 func.setCurrentIndex(func.findText(DEFAULT_POLYDISP_FUNCTION)) … … 1648 1648 lo = self.lstPoly.itemDelegate().poly_pd 1649 1649 hi = self.lstPoly.itemDelegate().poly_function 1650 [self._poly_model.item(row_index, i).setEnabled(False) for i in xrange(lo, hi)]1650 [self._poly_model.item(row_index, i).setEnabled(False) for i in range(lo, hi)] 1651 1651 return 1652 1652 except IOError: … … 1658 1658 self._poly_model.blockSignals(True) 1659 1659 max_range = self.lstPoly.itemDelegate().poly_filename 1660 [self._poly_model.item(row_index, i).setEnabled(True) for i in xrange(7)]1660 [self._poly_model.item(row_index, i).setEnabled(True) for i in range(7)] 1661 1661 file_index = self._poly_model.index(row_index, self.lstPoly.itemDelegate().poly_filename) 1662 self._poly_model.setData(file_index, QtCore.QVariant(""))1662 self._poly_model.setData(file_index, "") 1663 1663 self._poly_model.blockSignals(False) 1664 1664 … … 1669 1669 nsigs = POLYDISPERSITY_MODELS[str(combo_string)].default['nsigmas'] 1670 1670 1671 self._poly_model.setData(npts_index, QtCore.QVariant(npts))1672 self._poly_model.setData(nsigs_index, QtCore.QVariant(nsigs))1671 self._poly_model.setData(npts_index, npts) 1672 self._poly_model.setData(nsigs_index, nsigs) 1673 1673 1674 1674 self.iterateOverModel(updateFunctionCaption) … … 1681 1681 datafile = QtGui.QFileDialog.getOpenFileName( 1682 1682 self, "Choose a weight file", "", "All files (*.*)", 1683 None,QtGui.QFileDialog.DontUseNativeDialog)1683 QtGui.QFileDialog.DontUseNativeDialog) 1684 1684 1685 1685 if datafile is None or str(datafile)=='': … … 1710 1710 fname = os.path.basename(str(datafile)) 1711 1711 fname_index = self._poly_model.index(row_index, self.lstPoly.itemDelegate().poly_filename) 1712 self._poly_model.setData(fname_index, QtCore.QVariant(fname))1712 self._poly_model.setData(fname_index, fname) 1713 1713 1714 1714 def setMagneticModel(self): … … 1732 1732 top_index = self.kernel_module.multiplicity_info.number 1733 1733 shell_names = [] 1734 for i in xrange(1, top_index+1):1734 for i in range(1, top_index+1): 1735 1735 for name in multi_names: 1736 1736 shell_names.append(name+str(i)) … … 1782 1782 func = QtGui.QComboBox() 1783 1783 # Available range of shells displayed in the combobox 1784 func.addItems([str(i) for i in xrange(param_length+1)])1784 func.addItems([str(i) for i in range(param_length+1)]) 1785 1785 1786 1786 # Respond to index change -
src/sas/qtgui/Perspectives/Fitting/ModelThread.py
r6964d44 rb3e8629 65 65 if self.data is None: 66 66 msg = "Compute Calc2D receive data = %s.\n" % str(self.data) 67 raise ValueError , msg67 raise ValueError(msg) 68 68 69 69 # Define matrix where data will be plotted -
src/sas/qtgui/Perspectives/Fitting/ModelUtilities.py
r125c4be rb3e8629 2 2 Utilities to manage models 3 3 """ 4 from __future__ import print_function 4 5 5 6 6 import traceback … … 68 68 except: 69 69 msg = "Plugin %s error in __init__ \n\t: %s %s\n" % (str(name), 70 str(sys.exc_ type),70 str(sys.exc_info()[0]), 71 71 sys.exc_info()[1]) 72 72 plugin_log(msg) … … 78 78 except: 79 79 msg = "Plugin %s: error writing function \n\t :%s %s\n " % \ 80 (str(name), str(sys.exc_ type), sys.exc_info()[1])80 (str(name), str(sys.exc_info()[0]), sys.exc_info()[1]) 81 81 plugin_log(msg) 82 82 return None … … 138 138 Class to check for problems with specific values 139 139 """ 140 def __ nonzero__(self):140 def __bool__(self): 141 141 type, value, tb = sys.exc_info() 142 142 if type is not None and issubclass(type, py_compile.PyCompileError): 143 143 print("Problem with", repr(value)) 144 raise type , value, tb144 raise type(value).with_traceback(tb) 145 145 return 1 146 146 … … 211 211 212 212 """ 213 if name not in self.mydict.keys():213 if name not in list(self.mydict.keys()): 214 214 self.reset_list(name, mylist) 215 215 … … 292 292 #Looking for plugins 293 293 self.stored_plugins = self.findModels() 294 self.plugins = self.stored_plugins.values()295 for name, plug in self.stored_plugins.ite ritems():294 self.plugins = list(self.stored_plugins.values()) 295 for name, plug in self.stored_plugins.items(): 296 296 self.model_dictionary[name] = plug 297 297 … … 322 322 new_plugins = self.findModels() 323 323 if len(new_plugins) > 0: 324 for name, plug in new_plugins.ite ritems():325 if name not in self.stored_plugins.keys():324 for name, plug in new_plugins.items(): 325 if name not in list(self.stored_plugins.keys()): 326 326 self.stored_plugins[name] = plug 327 327 self.plugins.append(plug) … … 338 338 self.plugins = [] 339 339 new_plugins = _find_models() 340 for name, plug in new_plugins.ite ritems():341 for stored_name, stored_plug in self.stored_plugins.ite ritems():340 for name, plug in new_plugins.items(): 341 for stored_name, stored_plug in self.stored_plugins.items(): 342 342 if name == stored_name: 343 343 del self.stored_plugins[name] … … 358 358 359 359 """ 360 if int(evt.GetId()) in self.form_factor_dict.keys():360 if int(evt.GetId()) in list(self.form_factor_dict.keys()): 361 361 from sasmodels.sasview_model import MultiplicationModel 362 362 self.model_dictionary[MultiplicationModel.__name__] = MultiplicationModel … … 417 417 __modelmanager = ModelManagerBase() 418 418 cat_model_list = [__modelmanager.model_dictionary[model_name] for model_name \ 419 in __modelmanager.model_dictionary.keys() \420 if model_name not in __modelmanager.stored_plugins.keys()]419 in list(__modelmanager.model_dictionary.keys()) \ 420 if model_name not in list(__modelmanager.stored_plugins.keys())] 421 421 422 422 CategoryInstaller.check_install(model_list=cat_model_list) -
src/sas/qtgui/Perspectives/Fitting/OptionsWidget.py
r457d961 rb3e8629 96 96 """ 97 97 self.model = QtGui.QStandardItemModel() 98 for model_item in xrange(len(MODEL)):98 for model_item in range(len(MODEL)): 99 99 self.model.setItem(model_item, QtGui.QStandardItem()) 100 100 # Attach slot -
src/sas/qtgui/Perspectives/Fitting/SmearingWidget.py
- Property mode changed from 100644 to 100755
rdc5ef15 rb3e8629 65 65 """ 66 66 self.model = QtGui.QStandardItemModel() 67 for model_item in xrange(len(MODEL)):67 for model_item in range(len(MODEL)): 68 68 self.model.setItem(model_item, QtGui.QStandardItem()) 69 69 # Attach slot -
src/sas/qtgui/Perspectives/Invariant/InvariantDetails.py
- Property mode changed from 100644 to 100755
r28cda69 rb3e8629 5 5 6 6 # local 7 from UI.InvariantDetailsUI import Ui_Dialog8 from InvariantUtils import WIDGETS7 from .UI.InvariantDetailsUI import Ui_Dialog 8 from .InvariantUtils import WIDGETS 9 9 10 10 class DetailsDialog(QtGui.QDialog, Ui_Dialog): -
src/sas/qtgui/Perspectives/Invariant/InvariantPerspective.py
- Property mode changed from 100644 to 100755
r457d961 rb3e8629 15 15 16 16 # local 17 from UI.TabbedInvariantUI import Ui_tabbedInvariantUI18 from InvariantDetails import DetailsDialog19 from InvariantUtils import WIDGETS17 from .UI.TabbedInvariantUI import Ui_tabbedInvariantUI 18 from .InvariantDetails import DetailsDialog 19 from .InvariantUtils import WIDGETS 20 20 21 21 # The minimum q-value to be used when extrapolating … … 551 551 if not isinstance(data_item, list): 552 552 msg = "Incorrect type passed to the Invariant Perspective" 553 raise AttributeError , msg553 raise AttributeError(msg) 554 554 555 555 if not isinstance(data_item[0], QtGui.QStandardItem): 556 556 msg = "Incorrect type passed to the Invariant Perspective" 557 raise AttributeError , msg557 raise AttributeError(msg) 558 558 559 559 self._model_item = data_item[0] … … 631 631 self.calculateInvariant() 632 632 except: 633 msg = "Invariant Set_data: " + str(sys.exc_ value)633 msg = "Invariant Set_data: " + str(sys.exc_info()[1]) 634 634 #wx.PostEvent(self.parent, StatusEvent(status=msg, info="error")) 635 635 else: -
src/sas/qtgui/Perspectives/Invariant/InvariantUtils.py
rf721030 rb3e8629 1 1 def enum(*sequential, **named): 2 enums = dict( zip(sequential, range(len(sequential))), **named)2 enums = dict(list(zip(sequential, list(range(len(sequential))))), **named) 3 3 return type('Enum', (), enums) 4 4 -
src/sas/qtgui/Perspectives/__init__.py
- Property mode changed from 100644 to 100755
r7adc2a8 rb3e8629 2 2 # When adding a new perspective, this dictionary needs to be updated 3 3 4 from Fitting.FittingPerspective import FittingWindow5 from Invariant.InvariantPerspective import InvariantWindow4 from .Fitting.FittingPerspective import FittingWindow 5 from .Invariant.InvariantPerspective import InvariantWindow 6 6 7 7 PERSPECTIVES = {
Note: See TracChangeset
for help on using the changeset viewer.