Changeset b768e92 in sasview for src/sas/sasgui
- Timestamp:
- Jun 2, 2016 10:14:35 AM (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.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- ec30905
- Parents:
- 6afc14b (diff), 70305bd2 (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/sasgui
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/guiframe/local_perspectives/data_loader/data_loader.py
rd85c194 rfaa3ae7 155 155 """ 156 156 data_error = False 157 for error_data in item.errors: 157 if hasattr(item, 'errors'): 158 for error_data in item.errors: 159 data_error = True 160 message += "\tError: {0}\n".format(error_data) 161 else: 162 logging.error("Loader returned an invalid object:\n %s" % str(item)) 158 163 data_error = True 159 message += "\tError: {0}\n".format(error_data)164 160 165 data = self.parent.create_gui_data(item, p_file) 161 166 output[data.id] = data … … 203 208 error_message) 204 209 except: 210 logging.error(sys.exc_value) 205 211 any_error = True 206 212 if any_error or error_message != "": -
src/sas/sasgui/perspectives/calculator/model_editor.py
rcb4ef58 rbb841ef 30 30 from wx.py.editwindow import EditWindow 31 31 from sas.sasgui.guiframe.documentation_window import DocumentationWindow 32 from .pyconsole import show_model_output, check_model 32 33 33 34 … … 45 46 PANEL_WIDTH = 500 46 47 _BOX_WIDTH = 55 47 48 49 def _compile_file(path):50 """51 Compile the file in the path52 """53 try:54 import py_compile55 py_compile.compile(file=path, doraise=True)56 return ''57 except:58 _, value, _ = sys.exc_info()59 return value60 48 61 49 def _delete_file(path): … … 384 372 name2 = label[1] 385 373 self.write_string(fname, name1, name2) 386 self.compile_file(fname) 387 self.parent.update_custom_combo() 374 success = show_model_output(self, fname) 375 if success: 376 self.parent.update_custom_combo() 388 377 msg = self._notes 389 378 info = 'Info' … … 618 607 """ 619 608 path = self.fname 620 _compile_file(path)609 show_model_output(self, path) 621 610 622 611 def delete_file(self, path): … … 954 943 info = 'Info' 955 944 msg = '' 945 result, check_err = '', '' 956 946 # Sort out the errors if occur 957 947 # First check for valid python name then if the name already exists … … 969 959 self.write_file(self.fname, name, description, param_str, 970 960 pd_param_str, func_str) 961 try: 962 result, msg = check_model(self.fname), None 963 except Exception: 964 import traceback 965 result, msg = None, "error building model" 966 check_err = "\n"+traceback.format_exc(limit=2) 967 971 968 # Modified compiling test, as it will fail for sasmodels.sasview_model class 972 969 # Should add a test to check that the class is correctly built … … 1031 1028 color = 'red' 1032 1029 else: 1033 msg = "Successful! " 1030 self._notes = result 1031 msg = "Successful! Please look for %s in Customized Models."%name 1034 1032 msg += " " + self._notes 1035 msg += " Please look for it in the Customized Models."1036 1033 info = 'Info' 1037 1034 color = 'blue' … … 1041 1038 if self.base != None: 1042 1039 from sas.sasgui.guiframe.events import StatusEvent 1043 wx.PostEvent(self.base.parent, StatusEvent(status=msg, info=info)) 1040 wx.PostEvent(self.base.parent, 1041 StatusEvent(status=msg+check_err, info=info)) 1044 1042 self.warning = msg 1045 1043 … … 1333 1331 import copy 1334 1332 1335 import nu ympy1333 import numpy 1336 1334 1337 1335 from sas.sascalc.fit.pluginmodel import Model1DPlugin -
src/sas/sasgui/perspectives/calculator/pyconsole.py
rd85c194 r26d6e045 4 4 import sys 5 5 import os 6 7 import numpy as np 8 6 9 import wx 7 import wx.lib.dialogs 10 from wx.lib.dialogs import ScrolledMessageDialog 8 11 import wx.py.editor as editor 9 import wx.py.frame as frame10 import py_compile11 12 12 13 if sys.platform.count("win32") > 0: … … 18 19 PANEL_HEIGHT = 730 19 20 FONT_VARIANT = 1 20 ID_C OMPILE= wx.NewId()21 ID_CHECK_MODEL = wx.NewId() 21 22 ID_RUN = wx.NewId() 22 23 23 def c ompile_file(path):24 def check_model(path): 24 25 """ 25 C ompile a python file26 Check that the model on the path can run. 26 27 """ 28 # try running the model 29 from sasmodels.core import load_model, call_kernel 30 model = load_model(path) 31 32 q = np.array([0.01, 0.1]) 33 kernel = model.make_kernel([q]) 34 Iq = call_kernel(kernel, {}) 35 36 qx, qy = np.array([0.01, 0.01]), np.array([0.1, 0.1]) 37 kernel = model.make_kernel([qx, qy]) 38 Iqxy = call_kernel(kernel, {}) 39 40 result = """ 41 Iq(%s) = %s 42 Iqxy(%s, %s) = %s 43 """%(q, Iq, qx, qy, Iqxy) 44 45 return result 46 47 def show_model_output(parent, fname): 48 # Make sure we have a python file; not sure why we care though... 49 if not (fname and os.path.exists(fname) and fname.endswith('.py')): 50 mssg = "\n This is not a python file." 51 wx.MessageBox(str(mssg), 'Error', style=wx.ICON_ERROR) 52 return False 53 27 54 try: 28 import py_compile 29 py_compile.compile(file=path, doraise=True) 30 except: 31 type, value, traceback = sys.exc_info() 32 return value 33 return None 55 result, errmsg = check_model(fname), None 56 except Exception: 57 import traceback 58 result, errmsg = None, traceback.format_exc(limit=2) 59 60 parts = ["Running model '%s'..." % os.path.basename(fname)] 61 if errmsg is not None: 62 parts.extend(["", "Error occurred:", errmsg, ""]) 63 title, icon = "Error", wx.ICON_ERROR 64 else: 65 parts.extend(["", "Success:", result, ""]) 66 title, icon = "Info", wx.ICON_INFORMATION 67 text = "\n".join(parts) 68 dlg = ScrolledMessageDialog(parent, text, title, size=((550, 250))) 69 fnt = wx.Font(10, wx.TELETYPE, wx.NORMAL, wx.NORMAL) 70 dlg.GetChildren()[0].SetFont(fnt) 71 dlg.GetChildren()[0].SetInsertionPoint(0) 72 dlg.ShowModal() 73 dlg.Destroy() 74 return errmsg is None 34 75 35 76 class PyConsole(editor.EditorNotebookFrame): … … 65 106 self.Bind(wx.EVT_MENU, self.OnSaveFile, id=wx.ID_SAVE) 66 107 self.Bind(wx.EVT_MENU, self.OnSaveAsFile, id=wx.ID_SAVEAS) 67 self.Bind(wx.EVT_MENU, self.OnC ompile, id=ID_COMPILE)108 self.Bind(wx.EVT_MENU, self.OnCheckModel, id=ID_CHECK_MODEL) 68 109 self.Bind(wx.EVT_MENU, self.OnRun, id=ID_RUN) 69 self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateCompileMenu, id=ID_C OMPILE)110 self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateCompileMenu, id=ID_CHECK_MODEL) 70 111 self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateCompileMenu, id=ID_RUN) 71 112 self.Bind(wx.EVT_CLOSE, self.on_close) … … 81 122 """ 82 123 self.compileMenu = wx.Menu() 83 self.compileMenu.Append(ID_C OMPILE, 'Compile',84 ' Compile the file')124 self.compileMenu.Append(ID_CHECK_MODEL, 'Check model', 125 'Loading and run the model') 85 126 self.compileMenu.AppendSeparator() 86 127 self.compileMenu.Append(ID_RUN, 'Run in Shell', … … 192 233 Run 193 234 """ 194 if self._check_changed():235 if not self._check_saved(): 195 236 return True 196 237 if self.buffer and self.buffer.doc.filepath: … … 207 248 icon = wx.ICON_ERROR 208 249 wx.MessageBox(str(mssg), title, style=icon) 209 return 0210 211 def OnC ompile(self, event):250 return False 251 252 def OnCheckModel(self, event): 212 253 """ 213 254 Compile 214 255 """ 215 if self._check_changed():256 if not self._check_saved(): 216 257 return True 217 run_out = self.OnRun(None) 218 if self._get_err_msg(run_out): 219 if self._manager != None and self.panel != None: 220 self._manager.set_edit_menu_helper(self.parent) 221 # Update custom model list in fitpage combobox 222 wx.CallAfter(self._manager.update_custom_combo) 223 224 def _check_changed(self): 258 fname = self.editor.getStatus()[0] 259 success = show_model_output(self, fname) 260 261 # Update custom model list in fitpage combobox 262 if success and self._manager != None and self.panel != None: 263 self._manager.set_edit_menu_helper(self.parent) 264 wx.CallAfter(self._manager.update_custom_combo) 265 266 def _check_saved(self): 225 267 """ 226 268 If content was changed, suggest to save it first … … 228 270 if self.bufferHasChanged() and self.buffer.doc.filepath: 229 271 cancel = self.bufferSuggestSave() 230 if cancel: 231 return cancel 232 233 def _get_err_msg(self, text=''): 234 """ 235 Get err_msg 236 """ 237 name = None 238 mssg = "\n This is not a python file." 239 title = 'Error' 240 icon = wx.ICON_ERROR 241 try: 242 fname = self.editor.getStatus()[0] 243 name = os.path.basename(fname) 244 if name.split('.')[-1] != 'py': 245 wx.MessageBox(str(mssg), title, style=icon) 246 return False 247 msg = compile_file(fname) 248 except: 249 msg = None 250 if name == None: 251 wx.MessageBox(str(mssg), title, style=icon) 252 return False 253 mssg = "Compiling '%s'...\n" % name 254 if msg != None: 255 mssg += "Error occurred:\n" 256 mssg += str(msg) + "\n\n" 257 if text: 258 mssg += "Run-Test results:\n" 259 mssg += str(text) 260 title = 'Warning' 261 icon = wx.ICON_WARNING 262 else: 263 mssg += "Successful.\n\n" 264 if text: 265 if text.count('Failed') or text.count('Error:') > 0: 266 mssg += "But Simple Test FAILED: Please check your code.\n" 267 mssg += "Run-Test results:\n" 268 mssg += str(text) 269 title = 'Info' 270 icon = wx.ICON_INFORMATION 271 dlg = wx.lib.dialogs.ScrolledMessageDialog(self, mssg, title, 272 size=((550, 250))) 273 fnt = wx.Font(10, wx.TELETYPE, wx.NORMAL, wx.NORMAL) 274 dlg.GetChildren()[0].SetFont(fnt) 275 dlg.GetChildren()[0].SetInsertionPoint(0) 276 dlg.ShowModal() 277 dlg.Destroy() 272 return not cancel 278 273 return True 279 274 … … 286 281 event.Enable(True) 287 282 try: 288 if id == ID_C OMPILEor id == ID_RUN:283 if id == ID_CHECK_MODEL or id == ID_RUN: 289 284 menu_on = False 290 285 if self.buffer and self.buffer.doc.filepath: -
src/sas/sasgui/perspectives/fitting/__init__.py
r9e531f2 ra7c4ad2 39 39 data_files = [] 40 40 path = os.path.dirname(__file__) 41 #p_path = os.path.join(path, 'plugin_models')42 #for f in findall(p_path):43 #data_files.append(('plugin_models', [f]))41 p_path = os.path.join(path, 'plugin_models') 42 for f in findall(p_path): 43 data_files.append(('plugin_models', [f])) 44 44 # path = get_data_path(media="media") 45 45 for f in findall(path): -
src/sas/sasgui/perspectives/fitting/fitpage.py
rcb4ef58 r934ce649 1330 1330 qmin=float(self.qmin_x), 1331 1331 qmax=float(self.qmax_x), 1332 enable_smearer=enable_smearer, 1333 draw=True) 1332 enable_smearer=enable_smearer) 1334 1333 if flag: 1335 1334 #self.compute_chisqr(smearer= temp_smearer) … … 2606 2605 qmin=float(self.qmin_x), 2607 2606 qmax=float(self.qmax_x), 2608 enable_smearer=enable_smearer, 2609 draw=True) 2607 enable_smearer=enable_smearer) 2610 2608 2611 2609 self.state.enable_smearer = self.enable_smearer.GetValue() -
src/sas/sasgui/perspectives/fitting/fitpanel.py
rf60251f r05228b0 17 17 import models 18 18 _BOX_WIDTH = 80 19 20 19 21 20 class FitPanel(nb, PanelBase): … … 154 153 """ 155 154 """ 156 from bumps.options import FIT_CONFIG157 current = FIT_CONFIG.selected_name158 self.parent.SetTitle(self.window_name + " - Active Fitting Optimizer: " + current)159 155 pos = self.GetSelection() 160 156 if pos != -1: -
src/sas/sasgui/perspectives/fitting/fitting.py
r86b049b r934ce649 19 19 import time 20 20 from copy import deepcopy 21 import models21 import traceback 22 22 23 23 from sas.sascalc.dataloader.loader import Loader … … 46 46 from sas.sasgui.guiframe.documentation_window import DocumentationWindow 47 47 48 from . import models 49 48 50 MAX_NBR_DATA = 4 49 51 … … 56 58 ON_MAC = True 57 59 58 60 import bumps.options 61 from bumps.gui.fit_dialog import show_fit_config 62 try: 63 from bumps.gui.fit_dialog import EVT_FITTER_CHANGED 64 except ImportError: 65 # CRUFT: bumps 0.7.5.8 and below 66 EVT_FITTER_CHANGED = None # type: wx.PyCommandEvent 59 67 60 68 class Plugin(PluginBase): … … 254 262 msg += "and try it again." 255 263 wx.MessageBox(msg, 'Info') 256 # wx.PostEvent(self.parent, StatusEvent(status=msg, type='stop',257 # info='warning'))264 #evt = StatusEvent(status=msg, type='stop', info='warning') 265 #wx.PostEvent(self.parent, evt) 258 266 else: 259 267 self.delete_menu.Delete(event_id) … … 262 270 self.edit_menu.DeleteItem(item) 263 271 msg = "The custom model, %s, has been deleted." % label 264 wx.PostEvent(self.parent, StatusEvent(status=msg,265 type='stop', info='info'))272 evt = StatusEvent(status=msg, type='stop', info='info') 273 wx.PostEvent(self.parent, evt) 266 274 break 267 275 except: … … 501 509 self.parent.Bind(EVT_SLICER_PANEL, self._on_slicer_event) 502 510 self.parent.Bind(EVT_SLICER_PARS_UPDATE, self._onEVT_SLICER_PANEL) 511 512 # CRUFT: EVT_FITTER_CHANGED is not None for bumps 0.7.5.9 and above 513 if EVT_FITTER_CHANGED is not None: 514 self.parent.Bind(EVT_FITTER_CHANGED, self.on_fitter_changed) 515 self._set_fitter_label(bumps.options.FIT_CONFIG) 516 503 517 #self.parent._mgr.Bind(wx.aui.EVT_AUI_PANE_CLOSE,self._onclearslicer) 504 518 #Create reader when fitting panel are created … … 567 581 except: 568 582 msg = "Fitting: cannot deal with the theory received" 583 evt = StatusEvent(status=msg, info="error") 569 584 logging.error("set_theory " + msg + "\n" + str(sys.exc_value)) 570 wx.PostEvent(self.parent, 571 StatusEvent(status=msg, info="error")) 585 wx.PostEvent(self.parent, evt) 572 586 573 587 def set_state(self, state=None, datainfo=None, format=None): … … 763 777 Open the bumps options panel. 764 778 """ 765 try: 766 from bumps.gui.fit_dialog import show_fit_config 767 show_fit_config(self.parent, help=self.on_help) 768 except ImportError: 769 # CRUFT: Bumps 0.7.5.6 and earlier do not have the help button 770 from bumps.gui.fit_dialog import OpenFitOptions 771 OpenFitOptions() 779 show_fit_config(self.parent, help=self.on_help) 780 781 def on_fitter_changed(self, event): 782 self._set_fitter_label(event.config) 783 784 def _set_fitter_label(self, config): 785 self.fit_panel.parent.SetTitle(self.fit_panel.window_name 786 + " - Active Fitting Optimizer: " 787 + config.selected_name) 772 788 773 789 def on_help(self, algorithm_id): … … 954 970 if not page.param_toFit: 955 971 msg = "No fitting parameters for %s" % page.window_caption 956 wx.PostEvent(page.parent.parent, 957 StatusEvent(status=msg, info="error", 958 type="stop")) 972 evt = StatusEvent(status=msg, info="error", type="stop") 973 wx.PostEvent(page.parent.parent, evt) 959 974 return False 960 975 if not page._update_paramv_on_fit(): … … 962 977 msg += " invalid in %s" % \ 963 978 page.window_caption 964 wx.PostEvent(page.parent.parent, 965 StatusEvent(status=msg, info="error", 966 type="stop")) 979 evt = StatusEvent(status=msg, info="error", type="stop") 980 wx.PostEvent(page.parent.parent, evt) 967 981 return False 968 982 … … 985 999 except KeyboardInterrupt: 986 1000 msg = "Fitting terminated" 987 wx.PostEvent(self.parent, StatusEvent(status=msg, info="info",988 type="stop"))1001 evt = StatusEvent(status=msg, info="info", type="stop") 1002 wx.PostEvent(self.parent, evt) 989 1003 return True 990 1004 except: 991 1005 raise 992 1006 msg = "Fitting error: %s" % str(sys.exc_value) 993 wx.PostEvent(self.parent, StatusEvent(status=msg, info="error",994 type="stop"))1007 evt = StatusEvent(status=msg, info="error", type="stop") 1008 wx.PostEvent(self.parent, evt) 995 1009 return False 996 1010 ## If a thread is already started, stop it … … 1087 1101 # add data associated to the page created 1088 1102 if page != None: 1089 wx.PostEvent(self.parent, StatusEvent(status="Page Created",1090 info="info"))1103 evt = StatusEvent(status="Page Created", info="info") 1104 wx.PostEvent(self.parent, evt) 1091 1105 else: 1092 1106 msg = "Page was already Created" 1093 wx.PostEvent(self.parent, StatusEvent(status=msg,1094 info="warning"))1107 evt = StatusEvent(status=msg, info="warning") 1108 wx.PostEvent(self.parent, evt) 1095 1109 except: 1096 1110 msg = "Creating Fit page: %s" % sys.exc_value … … 1254 1268 msg = "Fit completed on %s \n" % str_time 1255 1269 msg += "Duration time: %s s.\n" % str(elapsed) 1256 wx.PostEvent(self.parent, StatusEvent(status=msg, info="info",1257 type="stop"))1270 evt = StatusEvent(status=msg, info="info", type="stop") 1271 wx.PostEvent(self.parent, evt) 1258 1272 1259 1273 if batch_outputs is None: … … 1405 1419 batch_inputs=batch_inputs) 1406 1420 1407 wx.PostEvent(self.parent, StatusEvent(status=msg, error="info",1408 type="stop"))1421 evt = StatusEvent(status=msg, error="info", type="stop") 1422 wx.PostEvent(self.parent, evt) 1409 1423 # Remove parameters that are not shown 1410 1424 cpage = self.fit_panel.get_page_by_id(uid) … … 1485 1499 msg = "Fit completed on %s \n" % str_time 1486 1500 msg += "Duration time: %s s.\n" % str(elapsed) 1487 wx.PostEvent(self.parent, StatusEvent(status=msg, info="info",1488 type="stop"))1501 evt = StatusEvent(status=msg, info="info", type="stop") 1502 wx.PostEvent(self.parent, evt) 1489 1503 wx.PostEvent(self.result_panel, PlotResultEvent(result=result)) 1490 1504 wx.CallAfter(self._update_fit_button, page_id) … … 1510 1524 not numpy.all(numpy.isfinite(res.pvec)): 1511 1525 msg = "Fitting did not converge!!!" 1512 wx.PostEvent(self.parent, 1513 StatusEvent(status=msg, 1514 info="warning", 1515 type="stop")) 1526 evt = StatusEvent(status=msg, info="warning", type="stop") 1527 wx.PostEvent(self.parent, evt) 1516 1528 wx.CallAfter(self._update_fit_button, page_id) 1517 1529 else: … … 1537 1549 except KeyboardInterrupt: 1538 1550 msg = "Singular point: Fitting Stoped." 1539 wx.PostEvent(self.parent, StatusEvent(status=msg, 1540 info="info", 1541 type="stop")) 1551 evt = StatusEvent(status=msg, info="info", type="stop") 1552 wx.PostEvent(self.parent, evt) 1542 1553 except: 1543 1554 msg = "Singular point: Fitting Error occurred." 1544 wx.PostEvent(self.parent, StatusEvent(status=msg, 1545 info="error", 1546 type="stop")) 1555 evt = StatusEvent(status=msg, info="error", type="stop") 1556 wx.PostEvent(self.parent, evt) 1547 1557 1548 1558 except: … … 1550 1560 % sys.exc_value) 1551 1561 #import traceback; msg = "\n".join((traceback.format_exc(), msg)) 1552 wx.PostEvent(self.parent, StatusEvent(status=msg, info="warning",1553 type="stop"))1562 evt = StatusEvent(status=msg, info="warning", type="stop") 1563 wx.PostEvent(self.parent, evt) 1554 1564 1555 1565 def _update_fit_button(self, page_id): … … 1588 1598 ## post a message to status bar 1589 1599 msg = "Set Chain Fitting: %s" % str(not self.batch_reset_flag) 1590 wx.PostEvent(self.parent, 1591 StatusEvent(status=msg)) 1600 wx.PostEvent(self.parent, StatusEvent(status=msg)) 1592 1601 1593 1602 … … 1735 1744 raise 1736 1745 1746 def _calc_exception(self, etype, value, tb): 1747 """ 1748 Handle exception from calculator by posting it as an error. 1749 """ 1750 logging.error("".join(traceback.format_exception(etype, value, tb))) 1751 msg = traceback.format_exception(etype, value, tb, limit=1) 1752 evt = StatusEvent(status="".join(msg), type="stop", info="error") 1753 wx.PostEvent(self.parent, evt) 1754 1737 1755 def _update2D(self, output, time=None): 1738 1756 """ 1739 1757 Update the output of plotting model 1740 1758 """ 1741 wx.PostEvent(self.parent, StatusEvent(status="Plot \ 1742 #updating ... ", type="update")) 1743 #self.ready_fit() 1759 msg = "Plot updating ... " 1760 wx.PostEvent(self.parent, StatusEvent(msg, type="update")) 1744 1761 1745 1762 def _complete2D(self, image, data, model, page_id, elapsed, index, qmin, … … 1847 1864 time.sleep(0.1) 1848 1865 self.calc_2D = Calc2D(model=model, 1849 data=data, 1850 page_id=page_id, 1851 smearer=smearer, 1852 qmin=qmin, 1853 qmax=qmax, 1854 weight=weight, 1855 fid=fid, 1856 toggle_mode_on=toggle_mode_on, 1857 state=state, 1858 completefn=self._complete2D, 1859 update_chisqr=update_chisqr, source=source) 1866 data=data, 1867 page_id=page_id, 1868 smearer=smearer, 1869 qmin=qmin, 1870 qmax=qmax, 1871 weight=weight, 1872 fid=fid, 1873 toggle_mode_on=toggle_mode_on, 1874 state=state, 1875 completefn=self._complete2D, 1876 update_chisqr=update_chisqr, 1877 exception_handler=self._calc_exception, 1878 source=source) 1860 1879 self.calc_2D.queue() 1861 1880 except: … … 1912 1931 #updatefn = self._update1D, 1913 1932 update_chisqr=update_chisqr, 1933 exception_handler=self._calc_exception, 1914 1934 source=source) 1915 1935 self.calc_1D.queue() -
src/sas/sasgui/perspectives/fitting/model_thread.py
rd85c194 r934ce649 25 25 source='model', 26 26 yieldtime=0.04, 27 worktime=0.04 27 worktime=0.04, 28 exception_handler=None, 28 29 ): 29 CalcThread.__init__(self, completefn, updatefn, yieldtime, worktime) 30 CalcThread.__init__(self, completefn, updatefn, yieldtime, worktime, 31 exception_handler=exception_handler) 30 32 self.qmin = qmin 31 33 self.qmax = qmax … … 133 135 updatefn=None, 134 136 yieldtime=0.01, 135 worktime=0.01 137 worktime=0.01, 138 exception_handler=None, 136 139 ): 137 140 """ 138 141 """ 139 CalcThread.__init__(self, completefn, 140 updatefn, 141 yieldtime, 142 worktime) 142 CalcThread.__init__(self, completefn, updatefn, yieldtime, worktime, 143 exception_handler=exception_handler) 143 144 self.fid = fid 144 145 self.data = data -
src/sas/sasgui/perspectives/invariant/media/invariant_help.rst
r7805458 r70305bd2 19 19 .. image:: image001.gif 20 20 21 where *g = Q* for pinhole geometry (SAS) and *g = Qv*(the slit height) for21 where *g = q* for pinhole geometry (SAS) and *g = q*\ :sub:`v` (the slit height) for 22 22 slit geometry (USAS). 23 23 -
src/sas/sasgui/plottools/plottables.py
rd7bb526 rcd54205 704 704 else: 705 705 self.dy = None 706 tempx = []707 tempy = []708 706 if not has_err_x: 709 707 dx = numpy.zeros(len(x)) … … 724 722 if has_err_y: 725 723 self.dy.append(tempdy) 726 except: 727 tempx = x[i] 728 tempy = y[i] 729 tempdy = dy[i] 724 except Exception: 725 pass 730 726 # Sanity check 731 727 if not len(self.x) == len(self.y): … … 733 729 msg += "and y are not of the same length" 734 730 raise ValueError, msg 735 if has_err_x and not (len(self.x) andlen(self.dx)):731 if has_err_x and not (len(self.x) == len(self.dx)): 736 732 msg = "Plottable.View: transformed x and dx" 737 733 msg += " are not of the same length" 738 734 raise ValueError, msg 739 if has_err_y and not (len(self.y) andlen(self.dy)):735 if has_err_y and not (len(self.y) == len(self.dy)): 740 736 msg = "Plottable.View: transformed y" 741 737 msg += " and dy are not of the same length" -
src/sas/sasgui/perspectives/fitting/models.py
rcb4ef58 r6afc14b 147 147 try: 148 148 import compileall 149 compileall.compile_dir(dir=dir, ddir=dir, force= 1,149 compileall.compile_dir(dir=dir, ddir=dir, force=0, 150 150 quiet=report_problem) 151 151 except:
Note: See TracChangeset
for help on using the changeset viewer.