Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

handling exceptions in bayesian analyses

  • Loading branch information...
commit eee5b2f6f1fddb73ba19a0b847b4bd6cfeb2c119 1 parent 34e2fc9
@bwallace authored
Showing with 18 additions and 5 deletions.
  1. +18 −5 ma_specs.py
View
23 ma_specs.py
@@ -18,6 +18,7 @@
from PyQt4 import QtCore, QtGui, Qt
from PyQt4.Qt import *
import pdb
+import sys
import copy
import sip
@@ -231,14 +232,26 @@ def run_ma(self):
if self.meta_f_str is None:
# regular meta-analysis
- result = meta_py_r.run_diagnostic_multi(method_names, list_of_param_vals)
+ try:
+ result = meta_py_r.run_diagnostic_multi(method_names, list_of_param_vals)
+ except Exception, e:
+ error_message = \
+ "sorry, something has gone wrong with your analysis. here is a stack trace that probably won't be terribly useful.\n %s" \
+ % e
+
+ QMessageBox.critical(self,
+ "analysis failed",
+ error_message)
+ bar.hide()
+ self.accept()
+
else:
# in the case of diagnostic, we pass in lists
# of param values to the meta_method
result = meta_py_r.run_meta_method_diag(\
- self.meta_f_str, method_names, list_of_param_vals)
+ self.meta_f_str, method_names, list_of_param_vals)
+
- #bar.close()
bar.hide()
# update the user_preferences object for the selected method
@@ -589,10 +602,10 @@ def setup_diagnostic_ui(self):
window_title, method_label = "", ""
if self.sens_spec:
window_title = "Method & Parameters for Sens./Spec."
- method_label = "analysis method for sens./spec."
+ method_label = "method for sens./spec."
else:
window_title = "Method & Parameters for DOR/LR"
- method_label = "analysis method for DOR/LR"
+ method_label = "method for DOR/LR"
self.setWindowTitle(QtGui.QApplication.translate("Dialog", window_title, \
None, QtGui.QApplication.UnicodeUTF8))
Please sign in to comment.
Something went wrong with that request. Please try again.