Changeset 6280464 in sasview for src/sas/qtgui/Calculators/SlitSizeCalculator.py
- Timestamp:
- Nov 3, 2017 10:58:39 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:
- 412e069e
- Parents:
- 304d082
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Calculators/SlitSizeCalculator.py
r0849aec r6280464 4 4 import os 5 5 import sys 6 import logging 6 7 7 8 from PyQt5 import QtCore … … 64 65 return 65 66 loader = Loader() 66 data = loader.load(path_str)[0] 67 try: 68 data = loader.load(path_str)[0] 69 # Can return multiple exceptions - gather them all under one umbrella and complain 70 except Exception as ex: 71 logging.error(ex) 72 return 67 73 68 74 self.data_file.setText(os.path.basename(path_str)) … … 79 85 "SAXSess 1D data (*.txt *.TXT *.dat *.DAT)", 80 86 None, 81 QtWidgets.QFileDialog.DontUseNativeDialog) 82 83 if path is None: 84 return 85 87 QtWidgets.QFileDialog.DontUseNativeDialog)[0] 86 88 return path 87 89 … … 106 108 self.clearResults() 107 109 msg = "ERROR: Data hasn't been loaded correctly" 108 raise RuntimeError(msg) 110 logging.error(msg) 111 return 109 112 110 113 if data.__class__.__name__ == 'Data2D': 111 114 self.clearResults() 112 115 msg = "Slit Length cannot be computed for 2D Data" 113 raise RuntimeError(msg) 116 logging.error(msg) 117 return 114 118 115 119 #compute the slit size … … 119 123 if xdata == [] or xdata is None or ydata == [] or ydata is None: 120 124 msg = "The current data is empty please check x and y" 121 raise ValueError(msg) 125 logging.error(msg) 126 return 122 127 slit_length_calculator = SlitlengthCalculator() 123 128 slit_length_calculator.set_data(x=xdata, y=ydata) … … 126 131 self.clearResults() 127 132 msg = "Slit Size Calculator: %s" % (sys.exc_info()[1]) 128 raise RuntimeError(msg) 133 logging.error(msg) 134 return 129 135 130 136 slit_length_str = "{:.5f}".format(slit_length)
Note: See TracChangeset
for help on using the changeset viewer.