Changeset fa81e94 in sasview for src/sas/sasgui/perspectives/corfunc
- Timestamp:
- Nov 15, 2017 4:33:09 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:
- d4881f6a
- Parents:
- 7c487846
- Location:
- src/sas/sasgui/perspectives/corfunc
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/corfunc/__init__.py
- Property mode changed from 100644 to 100755
rc23f303 rfa81e94 1 1 PLUGIN_ID = "Corfunc Plug-In 0.1" 2 from corfunc import *2 from .corfunc import * -
src/sas/sasgui/perspectives/corfunc/corfunc.py
- Property mode changed from 100644 to 100755
r9b90bf8 rfa81e94 18 18 from sas.sascalc.dataloader.loader import Loader 19 19 import sas.sascalc.dataloader 20 from plot_labels import *20 from .plot_labels import * 21 21 22 22 logger = logging.getLogger(__name__) … … 149 149 self.corfunc_panel.set_data(data) 150 150 except: 151 msg = "Corfunc set_data: " + str(sys.exc_ value)151 msg = "Corfunc set_data: " + str(sys.exc_info()[1]) 152 152 wx.PostEvent(self.parent, StatusEvent(status=msg, 153 153 info='error')) -
src/sas/sasgui/perspectives/corfunc/corfunc_panel.py
- Property mode changed from 100644 to 100755
r2a399ca rfa81e94 17 17 from sas.sascalc.corfunc.corfunc_calculator import CorfuncCalculator 18 18 from sas.sasgui.guiframe.documentation_window import DocumentationWindow 19 from plot_labels import *19 from .plot_labels import * 20 20 21 21 OUTPUT_STRINGS = { … … 393 393 if params is None: 394 394 # Reset outputs 395 for output in self._extrapolation_outputs.values():395 for output in list(self._extrapolation_outputs.values()): 396 396 output.SetValue('-') 397 397 return 398 for key, value in params.ite ritems():398 for key, value in params.items(): 399 399 output = self._extrapolation_outputs[key] 400 400 rounded = self._round_sig_figs(value, 6) … … 411 411 if params is None: 412 412 if not reset: error = True 413 for output in self._output_boxes.values():413 for output in list(self._output_boxes.values()): 414 414 output.SetValue('-') 415 415 else: … … 417 417 # Not all parameters were calculated 418 418 error = True 419 for key, value in params.ite ritems():419 for key, value in params.items(): 420 420 rounded = self._round_sig_figs(value, 6) 421 421 self._output_boxes[key].SetValue(rounded) … … 656 656 self._extrapolation_outputs['K'] = k_output 657 657 658 sigma_label = wx.StaticText(self, -1, u'\u03C3: ')658 sigma_label = wx.StaticText(self, -1, '\u03C3: ') 659 659 params_sizer.Add(sigma_label, (2, 2), (1, 1), wx.LEFT | wx.EXPAND, 15) 660 660 … … 713 713 self._output_boxes = dict() 714 714 i = 0 715 for key, value in OUTPUT_STRINGS.ite ritems():715 for key, value in OUTPUT_STRINGS.items(): 716 716 # Create a label and a text box for each poperty 717 717 label = wx.StaticText(self, -1, value) -
src/sas/sasgui/perspectives/corfunc/corfunc_state.py
- Property mode changed from 100644 to 100755
r1fa4f736 rfa81e94 74 74 if self.outputs != {} and self.outputs is not None: 75 75 state += "\nOutputs:\n" 76 for key, value in self.outputs.ite ritems():76 for key, value in self.outputs.items(): 77 77 name = output_list[key][1] 78 78 state += "{}: {}\n".format(name, str(value)) … … 158 158 state = new_doc.createElement("state") 159 159 top_element.appendChild(state) 160 for name, value in self.saved_state.ite ritems():160 for name, value in self.saved_state.items(): 161 161 element = new_doc.createElement(name) 162 162 element.appendChild(new_doc.createTextNode(str(value))) … … 181 181 output = new_doc.createElement("output") 182 182 top_element.appendChild(output) 183 for key, value in self.outputs.ite ritems():183 for key, value in self.outputs.items(): 184 184 element = new_doc.createElement(key) 185 185 element.appendChild(new_doc.createTextNode(str(value))) … … 216 216 except: 217 217 msg = ("CorfuncState.fromXML: Could not read timestamp", 218 "\n{}").format(sys.exc_ value)218 "\n{}").format(sys.exc_info()[1]) 219 219 logger.error(msg) 220 220 … … 222 222 entry = get_content('ns:state', node) 223 223 if entry is not None: 224 for item in DEFAULT_STATE. iterkeys():224 for item in DEFAULT_STATE.keys(): 225 225 input_field = get_content("ns:{}".format(item), entry) 226 226 if input_field is not None: … … 283 283 root, ext = os.path.splitext(basename) 284 284 if not ext.lower() in self.ext: 285 raise IOError , "{} is not a supported file type".format(ext)285 raise IOError("{} is not a supported file type".format(ext)) 286 286 tree = etree.parse(path, parser=etree.ETCompatXMLParser()) 287 287 root = tree.getroot() … … 299 299 # File not found 300 300 msg = "{} is not a valid file path or doesn't exist".format(path) 301 raise IOError , msg301 raise IOError(msg) 302 302 303 303 if len(output) == 0: … … 323 323 msg = ("The CanSAS writer expects a Data1D instance. {} was " 324 324 "provided").format(datainfo.__class__.__name__) 325 raise RuntimeError , msg325 raise RuntimeError(msg) 326 326 if datainfo.title is None or datainfo.title == '': 327 327 datainfo.title = datainfo.name … … 360 360 except: 361 361 msg = "XML document does not contain CorfuncState information\n{}" 362 msg.format(sys.exc_ value)362 msg.format(sys.exc_info()[1]) 363 363 logger.info(msg) 364 364 return state
Note: See TracChangeset
for help on using the changeset viewer.