Changeset b0b09b9 in sasview for src/sas/qtgui/Perspectives
- Timestamp:
- Oct 26, 2017 3:13:05 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:
- 895e7359
- Parents:
- def64a0
- Location:
- src/sas/qtgui/Perspectives
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FitThread.py
ree18d33 rb0b09b9 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 rb0b09b9 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 rb0b09b9 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
- Property mode changed from 100644 to 100755
r377ade1 rb0b09b9 11 11 from sas.qtgui.Perspectives.Fitting.FittingWidget import FittingWidget 12 12 from sas.qtgui.Perspectives.Fitting.FittingOptions import FittingOptions 13 from sas.qtgui.Perspectives.Fitting import ModelUtilities13 #from sas.qtgui.Perspectives.Fitting import ModelUtilities 14 14 15 15 class FittingWindow(QtGui.QTabWidget): … … 61 61 self.fit_options_widget.fit_option_changed.connect(self.onFittingOptionsChange) 62 62 63 self.menu_manager = ModelUtilities.ModelManager()64 # TODO: reuse these in FittingWidget properly65 self.model_list_box = self.menu_manager.get_model_list()66 self.model_dictionary = self.menu_manager.get_model_dictionary()63 #self.menu_manager = ModelUtilities.ModelManager() 64 ## TODO: reuse these in FittingWidget properly 65 #self.model_list_box = self.menu_manager.get_model_list() 66 #self.model_dictionary = self.menu_manager.get_model_dictionary() 67 67 68 68 #self.setWindowTitle('Fit panel - Active Fitting Optimizer: %s' % self.optimizer) … … 120 120 Create a list if none exists and append if there's already a list 121 121 """ 122 if item_key in self.dataToFitTab.keys(): 123 self.dataToFitTab[item_key].append(tab_name) 122 item_key_str = str(item_key) 123 if item_key_str in list(self.dataToFitTab.keys()): 124 self.dataToFitTab[item_key_str].append(tab_name) 124 125 else: 125 self.dataToFitTab[item_key ] = [tab_name]126 self.dataToFitTab[item_key_str] = [tab_name] 126 127 127 128 #print "CURRENT dict: ", self.dataToFitTab … … 169 170 Given name of the fitting tab - close it 170 171 """ 171 for tab_index in xrange(len(self.tabs)):172 for tab_index in range(len(self.tabs)): 172 173 if self.tabText(tab_index) == tab_name: 173 174 self.tabCloses(tab_index) … … 181 182 return 182 183 for index_to_delete in index_list: 183 if index_to_delete in self.dataToFitTab.keys(): 184 for tab_name in self.dataToFitTab[index_to_delete]: 184 index_to_delete_str = str(index_to_delete) 185 if index_to_delete_str in list(self.dataToFitTab.keys()): 186 for tab_name in self.dataToFitTab[index_to_delete_str]: 185 187 # delete tab #index after corresponding data got removed 186 188 self.closeTabByName(tab_name) 187 self.dataToFitTab.pop(index_to_delete )189 self.dataToFitTab.pop(index_to_delete_str) 188 190 189 191 #print "CURRENT dict: ", self.dataToFitTab … … 205 207 if not isinstance(data_item, list): 206 208 msg = "Incorrect type passed to the Fitting Perspective" 207 raise AttributeError , msg209 raise AttributeError(msg) 208 210 209 211 if not isinstance(data_item[0], QtGui.QStandardItem): 210 212 msg = "Incorrect type passed to the Fitting Perspective" 211 raise AttributeError , msg213 raise AttributeError(msg) 212 214 213 215 items = [data_item] if is_batch else data_item … … 216 218 # Find the first unassigned tab. 217 219 # If none, open a new tab. 218 available_tabs = list( map(lambda tab: tab.acceptsData(), self.tabs))220 available_tabs = list([tab.acceptsData() for tab in self.tabs]) 219 221 220 222 if numpy.any(available_tabs): -
src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py
- Property mode changed from 100644 to 100755
rd0dfcb2 rb0b09b9 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
- Property mode changed from 100644 to 100755
rdef64a0 rb0b09b9 2 2 import os 3 3 from collections import defaultdict 4 from itertools import izip 4 5 5 6 6 import logging … … 69 69 if role == QtCore.Qt.ToolTipRole: 70 70 if orientation == QtCore.Qt.Horizontal: 71 return QtCore.QString(str(self.header_tooltips[section]))71 return str(self.header_tooltips[section]) 72 72 73 73 return QtGui.QStandardItemModel.headerData(self, section, orientation, role) … … 353 353 # Similarly on other tabs 354 354 self.options_widget.setEnablementOnDataLoad() 355 355 self.onSelectModel() 356 356 # Smearing tab 357 357 self.smearing_widget.updateSmearing(self.data) … … 473 473 model = str(self.cbModel.currentText()) 474 474 475 # empty combobox forced to be read 476 if not model: 477 return 475 478 # Reset structure factor 476 479 self.cbStructureFactor.setCurrentIndex(0) … … 763 766 """ 764 767 """ 765 print "UPDATE FIT"768 print("UPDATE FIT") 766 769 pass 767 770 … … 769 772 """ 770 773 """ 771 print "FIT FAILED: ", reason774 print("FIT FAILED: ", reason) 772 775 pass 773 776 … … 814 817 param_values = res.pvec # array([ 0.36221662, 0.0146783 ]) 815 818 param_stderr = res.stderr # array([ 1.71293015, 1.71294233]) 816 params_and_errors = zip(param_values, param_stderr)817 param_dict = dict( izip(param_list, params_and_errors))819 params_and_errors = list(zip(param_values, param_stderr)) 820 param_dict = dict(zip(param_list, params_and_errors)) 818 821 819 822 # Dictionary of fitted parameter: value, error … … 836 839 Take func and throw it inside the model row loop 837 840 """ 838 for row_i in xrange(self._model_model.rowCount()):841 for row_i in range(self._model_model.rowCount()): 839 842 func(row_i) 840 843 … … 851 854 # internal so can use closure for param_dict 852 855 param_name = str(self._model_model.item(row, 0).text()) 853 if param_name not in param_dict.keys():856 if param_name not in list(param_dict.keys()): 854 857 return 855 858 # modify the param value … … 863 866 # Utility function for updateof polydispersity part of the main model 864 867 param_name = str(self._model_model.item(row, 0).text())+'.width' 865 if param_name not in param_dict.keys():868 if param_name not in list(param_dict.keys()): 866 869 return 867 870 # modify the param value … … 878 881 return str(self._model_model.item(row, 0).text()) 879 882 880 [createItem(param_name) for param_name in param_dict.keys() if curr_param() == param_name]883 [createItem(param_name) for param_name in list(param_dict.keys()) if curr_param() == param_name] 881 884 882 885 error_column.append(item) … … 922 925 Take func and throw it inside the poly model row loop 923 926 """ 924 for row_i in xrange(self._poly_model.rowCount()):927 for row_i in range(self._poly_model.rowCount()): 925 928 func(row_i) 926 929 … … 931 934 return 932 935 param_name = str(self._poly_model.item(row_i, 0).text()).rsplit()[-1] + '.width' 933 if param_name not in param_dict.keys():936 if param_name not in list(param_dict.keys()): 934 937 return 935 938 # modify the param value … … 954 957 return str(self._poly_model.item(row_i, 0).text()).rsplit()[-1] + '.width' 955 958 956 [createItem(param_name) for param_name in param_dict.keys() if poly_param() == param_name]959 [createItem(param_name) for param_name in list(param_dict.keys()) if poly_param() == param_name] 957 960 958 961 error_column.append(item) … … 991 994 Take func and throw it inside the magnet model row loop 992 995 """ 993 for row_i in xrange(self._model_model.rowCount()):996 for row_i in range(self._model_model.rowCount()): 994 997 func(row_i) 995 998 … … 998 1001 # internal so can use closure for param_dict 999 1002 param_name = str(self._magnet_model.item(row, 0).text()) 1000 if param_name not in param_dict.keys():1003 if param_name not in list(param_dict.keys()): 1001 1004 return 1002 1005 # modify the param value … … 1016 1019 return str(self._magnet_model.item(row, 0).text()) 1017 1020 1018 [createItem(param_name) for param_name in param_dict.keys() if curr_param() == param_name]1021 [createItem(param_name) for param_name in list(param_dict.keys()) if curr_param() == param_name] 1019 1022 1020 1023 error_column.append(item) … … 1291 1294 # Unparsable field 1292 1295 return 1293 parameter_name = str(self._model_model.data(name_index) .toPyObject()) # sld, background etc.1296 parameter_name = str(self._model_model.data(name_index)) #.toPyObject()) # sld, background etc. 1294 1297 1295 1298 # Update the parameter value - note: this supports +/-inf as well … … 1357 1360 1358 1361 return [str(model.item(row_index, 0).text()) 1359 for row_index in xrange(model.rowCount())1362 for row_index in range(model.rowCount()) 1360 1363 if isChecked(row_index)] 1361 1364 … … 1398 1401 fitted_data.symbol = 'Line' 1399 1402 # Notify the GUI manager so it can update the main model in DataExplorer 1400 GuiUtils.updateModelItemWithPlot(self._index, QtCore.QVariant(fitted_data), name)1403 GuiUtils.updateModelItemWithPlot(self._index, fitted_data, name) 1401 1404 1402 1405 def createTheoryIndex(self, fitted_data): … … 1406 1409 name = self.nameFromData(fitted_data) 1407 1410 # Notify the GUI manager so it can create the theory model in DataExplorer 1408 new_item = GuiUtils.createModelItemWithPlot( QtCore.QVariant(fitted_data), name=name)1411 new_item = GuiUtils.createModelItemWithPlot(fitted_data, name=name) 1409 1412 self.communicate.updateTheoryFromPerspectiveSignal.emit(new_item) 1410 1413 … … 1460 1463 Thread returned error 1461 1464 """ 1462 print "Calculate Data failed with ", reason1465 print("Calculate Data failed with ", reason) 1463 1466 1464 1467 def complete1D(self, return_data): … … 1557 1560 else: 1558 1561 # Create as many entries as current shells 1559 for ishell in xrange(1, self.current_shell_displayed+1):1562 for ishell in range(1, self.current_shell_displayed+1): 1560 1563 # Remove [n] and add the shell numeral 1561 1564 name = param_name[0:param_name.index('[')] + str(ishell) … … 1585 1588 # All possible polydisp. functions as strings in combobox 1586 1589 func = QtGui.QComboBox() 1587 func.addItems([str(name_disp) for name_disp in POLYDISPERSITY_MODELS. iterkeys()])1590 func.addItems([str(name_disp) for name_disp in POLYDISPERSITY_MODELS.keys()]) 1588 1591 # Set the default index 1589 1592 func.setCurrentIndex(func.findText(DEFAULT_POLYDISP_FUNCTION)) … … 1636 1639 lo = self.lstPoly.itemDelegate().poly_pd 1637 1640 hi = self.lstPoly.itemDelegate().poly_function 1638 [self._poly_model.item(row_index, i).setEnabled(False) for i in xrange(lo, hi)]1641 [self._poly_model.item(row_index, i).setEnabled(False) for i in range(lo, hi)] 1639 1642 return 1640 1643 except IOError: … … 1646 1649 self._poly_model.blockSignals(True) 1647 1650 max_range = self.lstPoly.itemDelegate().poly_filename 1648 [self._poly_model.item(row_index, i).setEnabled(True) for i in xrange(7)]1651 [self._poly_model.item(row_index, i).setEnabled(True) for i in range(7)] 1649 1652 file_index = self._poly_model.index(row_index, self.lstPoly.itemDelegate().poly_filename) 1650 self._poly_model.setData(file_index, QtCore.QVariant(""))1653 self._poly_model.setData(file_index, "") 1651 1654 self._poly_model.blockSignals(False) 1652 1655 … … 1657 1660 nsigs = POLYDISPERSITY_MODELS[str(combo_string)].default['nsigmas'] 1658 1661 1659 self._poly_model.setData(npts_index, QtCore.QVariant(npts))1660 self._poly_model.setData(nsigs_index, QtCore.QVariant(nsigs))1662 self._poly_model.setData(npts_index, npts) 1663 self._poly_model.setData(nsigs_index, nsigs) 1661 1664 1662 1665 self.iterateOverModel(updateFunctionCaption) … … 1669 1672 datafile = QtGui.QFileDialog.getOpenFileName( 1670 1673 self, "Choose a weight file", "", "All files (*.*)", 1671 None,QtGui.QFileDialog.DontUseNativeDialog)1674 QtGui.QFileDialog.DontUseNativeDialog) 1672 1675 1673 1676 if datafile is None or str(datafile)=='': … … 1698 1701 fname = os.path.basename(str(datafile)) 1699 1702 fname_index = self._poly_model.index(row_index, self.lstPoly.itemDelegate().poly_filename) 1700 self._poly_model.setData(fname_index, QtCore.QVariant(fname))1703 self._poly_model.setData(fname_index, fname) 1701 1704 1702 1705 def setMagneticModel(self): … … 1720 1723 top_index = self.kernel_module.multiplicity_info.number 1721 1724 shell_names = [] 1722 for i in xrange(1, top_index+1):1725 for i in range(1, top_index+1): 1723 1726 for name in multi_names: 1724 1727 shell_names.append(name+str(i)) … … 1770 1773 func = QtGui.QComboBox() 1771 1774 # Available range of shells displayed in the combobox 1772 func.addItems([str(i) for i in xrange(param_length+1)])1775 func.addItems([str(i) for i in range(param_length+1)]) 1773 1776 1774 1777 # Respond to index change -
src/sas/qtgui/Perspectives/Fitting/ModelThread.py
r6964d44 rb0b09b9 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 rb0b09b9 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 rb0b09b9 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 rb0b09b9 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 rb0b09b9 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 rb0b09b9 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 rb0b09b9 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 rb0b09b9 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.