Changeset f2940c4 in sasview for src/sas/sasgui/perspectives/fitting
- Timestamp:
- Apr 4, 2017 11:10:30 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:
- 01febaf
- Parents:
- 9c0f3c17 (diff), dd11014 (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/perspectives/fitting
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/basepage.py
red2276f r9c0f3c17 34 34 from sas.sasgui.guiframe.documentation_window import DocumentationWindow 35 35 36 logger = logging.getLogger(__name__) 36 37 37 38 (PageInfoEvent, EVT_PAGE_INFO) = wx.lib.newevent.NewEvent() … … 782 783 except Exception: 783 784 # Skip non-data lines 784 logg ing.error(traceback.format_exc())785 logger.error(traceback.format_exc()) 785 786 return np.array(angles), np.array(weights) 786 787 except: … … 1304 1305 [state.values, state.weights] 1305 1306 except Exception: 1306 logg ing.error(traceback.format_exc())1307 logger.error(traceback.format_exc()) 1307 1308 selection = self._find_polyfunc_selection(disp_model) 1308 1309 for list in self.fittable_param: … … 1321 1322 list[6].Disable() 1322 1323 except Exception: 1323 logg ing.error(traceback.format_exc())1324 logger.error(traceback.format_exc()) 1324 1325 # For array, disable all fixed params 1325 1326 if selection == 1: … … 1330 1331 item[2].Disable() 1331 1332 except Exception: 1332 logg ing.error(traceback.format_exc())1333 logger.error(traceback.format_exc()) 1333 1334 1334 1335 def _selectDlg(self): … … 1451 1452 self.Refresh() 1452 1453 1453 # logg ing.info("is_modified flag set to %g",is_modified)1454 # logger.info("is_modified flag set to %g",is_modified) 1454 1455 return is_modified 1455 1456 … … 1556 1557 self.save_current_state() 1557 1558 except Exception: 1558 logg ing.error(traceback.format_exc())1559 logger.error(traceback.format_exc()) 1559 1560 1560 1561 return flag, is_modified … … 2371 2372 self.model.set_dispersion(p, disp_model) 2372 2373 except Exception: 2373 logg ing.error(traceback.format_exc())2374 logger.error(traceback.format_exc()) 2374 2375 2375 2376 # save state into … … 2486 2487 self.Refresh() 2487 2488 except Exception: 2488 logg ing.error(traceback.format_exc())2489 logger.error(traceback.format_exc()) 2489 2490 # Error msg 2490 2491 msg = "Error occurred:" … … 2587 2588 del self.state.model._persistency_dict[name.split('.')[0]] 2588 2589 except Exception: 2589 logg ing.error(traceback.format_exc())2590 logger.error(traceback.format_exc()) 2590 2591 2591 2592 def _lay_out(self): … … 2719 2720 except Exception: 2720 2721 # Not for control panels 2721 logg ing.error(traceback.format_exc())2722 logger.error(traceback.format_exc()) 2722 2723 # Make sure the resduals plot goes to the last 2723 2724 if res_item is not None: … … 3052 3053 disfunc = str(item[7].GetValue()) 3053 3054 except Exception: 3054 logg ing.error(traceback.format_exc())3055 logger.error(traceback.format_exc()) 3055 3056 3056 3057 # 2D … … 3095 3096 disfunc += ' ' + str(weight) 3096 3097 except Exception: 3097 logg ing.error(traceback.format_exc())3098 logger.error(traceback.format_exc()) 3098 3099 content += name + ',' + str(check) + ',' + value + disfunc + ',' + \ 3099 3100 bound_lo + ',' + bound_hi + ':' … … 3366 3367 3367 3368 except Exception: 3368 logg ing.error(traceback.format_exc())3369 logger.error(traceback.format_exc()) 3369 3370 print "Error in BasePage._paste_poly_help: %s" % \ 3370 3371 sys.exc_info()[1] -
src/sas/sasgui/perspectives/fitting/fitting.py
red2276f r9c0f3c17 48 48 49 49 from . import models 50 51 logger = logging.getLogger(__name__) 50 52 51 53 MAX_NBR_DATA = 4 … … 119 121 self.page_finder = {} 120 122 # Log startup 121 logg ing.info("Fitting plug-in started")123 logger.info("Fitting plug-in started") 122 124 self.batch_capable = self.get_batch_capable() 123 125 … … 346 348 page.formfactorbox.SetLabel(current_val) 347 349 except: 348 logg ing.error("update_custom_combo: %s", sys.exc_value)350 logger.error("update_custom_combo: %s", sys.exc_value) 349 351 350 352 def set_edit_menu(self, owner): … … 586 588 msg = "Fitting: cannot deal with the theory received" 587 589 evt = StatusEvent(status=msg, info="error") 588 logg ing.error("set_theory " + msg + "\n" + str(sys.exc_value))590 logger.error("set_theory " + msg + "\n" + str(sys.exc_value)) 589 591 wx.PostEvent(self.parent, evt) 590 592 … … 1796 1798 Handle exception from calculator by posting it as an error. 1797 1799 """ 1798 logg ing.error("".join(traceback.format_exception(etype, value, tb)))1800 logger.error("".join(traceback.format_exception(etype, value, tb))) 1799 1801 msg = traceback.format_exception(etype, value, tb, limit=1) 1800 1802 evt = StatusEvent(status="".join(msg), type="stop", info="error") -
src/sas/sasgui/perspectives/fitting/models.py
r11b094f r463e7ffc 18 18 from sas.sasgui.guiframe.CategoryInstaller import CategoryInstaller 19 19 from sasmodels.sasview_model import load_custom_model, load_standard_models 20 21 logger = logging.getLogger(__name__) 20 22 21 23 … … 168 170 if not os.path.isdir(dir): 169 171 msg = "SasView couldn't locate Model plugin folder %r." % dir 170 logg ing.warning(msg)172 logger.warning(msg) 171 173 return {} 172 174 173 175 plugin_log("looking for models in: %s" % str(dir)) 174 176 #compile_file(dir) #always recompile the folder plugin 175 logg ing.info("plugin model dir: %s" % str(dir))177 logger.info("plugin model dir: %s" % str(dir)) 176 178 177 179 plugins = {} … … 188 190 msg += "\nwhile accessing model in %r" % path 189 191 plugin_log(msg) 190 logg ing.warning("Failed to load plugin %r. See %s for details"192 logger.warning("Failed to load plugin %r. See %s for details" 191 193 % (path, PLUGIN_LOG)) 192 194 … … 261 263 if self.is_changed(): 262 264 return _findModels(dir) 263 logg ing.info("plugin model : %s" % str(temp))265 logger.info("plugin model : %s" % str(temp)) 264 266 return temp 265 267 -
src/sas/sasgui/perspectives/fitting/pagestate.py
red2276f r9c0f3c17 33 33 from sas.sascalc.dataloader.data_info import Data2D, Collimation, Detector 34 34 from sas.sascalc.dataloader.data_info import Process, Aperture 35 36 logger = logging.getLogger(__name__) 35 37 36 38 # Information to read/write state as xml … … 395 397 msg = "Save state does not have enough information to load" 396 398 msg += " the all of the data." 397 logg ing.warning(msg=msg)399 logger.warning(msg=msg) 398 400 else: 399 401 self.formfactorcombobox = FIRST_FORM[self.categorycombobox] … … 620 622 except Exception: 621 623 msg = "Report string expected 'name: value' but got %r" % line 622 logg ing.error(msg)624 logger.error(msg) 623 625 if name.count("State created"): 624 626 repo_time = "" + value … … 662 664 except Exception: 663 665 msg = "While parsing 'data: ...'\n" 664 logg ing.error(msg + traceback.format_exc())666 logger.error(msg + traceback.format_exc()) 665 667 if name == "model name ": 666 668 try: … … 678 680 except Exception: 679 681 msg = "While parsing 'Plotting Range: ...'\n" 680 logg ing.error(msg + traceback.format_exc())682 logger.error(msg + traceback.format_exc()) 681 683 paramval = "" 682 684 for lines in param_string.split(":"): … … 1037 1039 msg = "PageState.fromXML: Could not" 1038 1040 msg += " read timestamp\n %s" % sys.exc_value 1039 logg ing.error(msg)1041 logger.error(msg) 1040 1042 1041 1043 if entry is not None: … … 1077 1079 except Exception: 1078 1080 base = "unable to load distribution %r for %s" 1079 logg ing.error(base % (value, parameter))1081 logger.error(base % (value, parameter)) 1080 1082 continue 1081 1083 _disp_obj_dict = getattr(self, varname) … … 1099 1101 msg = ("Error reading %r from %s %s\n" 1100 1102 % (line, tagname, name)) 1101 logg ing.error(msg + traceback.format_exc())1103 logger.error(msg + traceback.format_exc()) 1102 1104 dic[name] = np.array(value_list) 1103 1105 setattr(self, varname, dic) … … 1207 1209 1208 1210 except: 1209 logg ing.info("XML document does not contain fitting information.\n"1211 logger.info("XML document does not contain fitting information.\n" 1210 1212 + traceback.format_exc()) 1211 1213
Note: See TracChangeset
for help on using the changeset viewer.