Changeset 00f7ff1 in sasview for src/sas/sasgui/perspectives/fitting/fitting.py
- Timestamp:
- Jun 21, 2017 11:17:18 AM (7 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, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 81b35396
- Parents:
- 2a0f33f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/fitting.py
r2a0f33f r00f7ff1 23 23 import traceback 24 24 25 import bumps.options 26 from bumps.gui.fit_dialog import show_fit_config 27 try: 28 from bumps.gui.fit_dialog import EVT_FITTER_CHANGED 29 except ImportError: 30 # CRUFT: bumps 0.7.5.8 and below 31 EVT_FITTER_CHANGED = None # type: wx.PyCommandEvent 32 25 33 from sas.sascalc.dataloader.loader import Loader 26 34 from sas.sascalc.fit.BumpsFitting import BumpsFit as Fit 27 from sas.sascalc.fit.pagestate import Reader 35 from sas.sascalc.fit.pagestate import Reader, PageState, SimFitPageState 28 36 29 37 from sas.sasgui.guiframe.dataFitting import Data2D … … 37 45 from sas.sasgui.guiframe.plugin_base import PluginBase 38 46 from sas.sasgui.guiframe.data_processor import BatchCell 39 from sas.sasgui.perspectives.fitting.console import ConsoleUpdate 40 from sas.sasgui.perspectives.fitting.fitproblem import FitProblemDictionary 41 from sas.sasgui.perspectives.fitting.fitpanel import FitPanel 42 from sas.sasgui.perspectives.fitting.resultpanel import ResultPanel, PlotResultEvent 43 44 from sas.sasgui.perspectives.fitting.fit_thread import FitThread 45 from sas.sasgui.perspectives.fitting.pagestate import Reader 46 from sas.sasgui.perspectives.fitting.fitpage import Chi2UpdateEvent 47 from sas.sasgui.guiframe.gui_manager import MDIFrame 48 from sas.sasgui.guiframe.documentation_window import DocumentationWindow 49 47 50 from sas.sasgui.perspectives.calculator.model_editor import TextDialog 48 51 from sas.sasgui.perspectives.calculator.model_editor import EditorWindow 49 from sas.sasgui.guiframe.gui_manager import MDIFrame 50 from sas.sasgui.guiframe.documentation_window import DocumentationWindow 51 from sas.sasgui.perspectives.fitting.gpu_options import GpuOptions 52 52 53 from .fitting_widgets import DataDialog 54 from .fit_thread import FitThread 55 from .fitpage import Chi2UpdateEvent 56 from .console import ConsoleUpdate 57 from .fitproblem import FitProblemDictionary 58 from .fitpanel import FitPanel 59 from .model_thread import Calc1D, Calc2D 60 from .resultpanel import ResultPanel, PlotResultEvent 61 from .gpu_options import GpuOptions 53 62 from . import models 54 63 … … 65 74 ON_MAC = True 66 75 67 import bumps.options68 from bumps.gui.fit_dialog import show_fit_config69 try:70 from bumps.gui.fit_dialog import EVT_FITTER_CHANGED71 except ImportError:72 # CRUFT: bumps 0.7.5.8 and below73 EVT_FITTER_CHANGED = None # type: wx.PyCommandEvent74 76 75 77 class Plugin(PluginBase): … … 240 242 Get the python editor panel 241 243 """ 244 from sas.sasgui.perspectives.calculator.pyconsole import PyConsole 245 242 246 event_id = event.GetId() 243 247 label = self.edit_menu.GetLabel(event_id) 244 from sas.sasgui.perspectives.calculator.pyconsole import PyConsole245 248 filename = os.path.join(models.find_plugins_dir(), label) 246 249 frame = PyConsole(parent=self.parent, manager=self, … … 284 287 break 285 288 except Exception: 286 import traceback;traceback.print_exc()289 traceback.print_exc() 287 290 msg = 'Delete Error: \nCould not delete the file; Check if in use.' 288 291 wx.MessageBox(msg, 'Error') … … 558 561 else: 559 562 if len(data_list) > MAX_NBR_DATA: 560 from fitting_widgets import DataDialog561 563 dlg = DataDialog(data_list=data_list, nb_data=MAX_NBR_DATA) 562 564 if dlg.ShowModal() == wx.ID_OK: … … 603 605 : param datainfo: data 604 606 """ 605 from pagestate import PageState606 from simfitpage import SimFitPageState607 607 if isinstance(state, PageState): 608 608 state = state.clone() 609 609 self.temp_state.append(state) 610 610 elif isinstance(state, SimFitPageState): 611 state.load_from_save_state(self) 611 if self.fit_panel.sim_page is None: 612 self.fit_panel.add_sim_page() 613 self.fit_panel.sim_page.load_from_save_state(state) 612 614 else: 613 615 self.temp_state = [] … … 1456 1458 if "Data" not in batch_outputs.keys(): 1457 1459 batch_outputs["Data"] = [] 1458 from sas.sasgui.guiframe.data_processor import BatchCell1459 1460 cell = BatchCell() 1460 1461 cell.label = data.name … … 1565 1566 msg = ("Fit completed but the following error occurred: %s" 1566 1567 % sys.exc_value) 1567 # import traceback;msg = "\n".join((traceback.format_exc(), msg))1568 #msg = "\n".join((traceback.format_exc(), msg)) 1568 1569 evt = StatusEvent(status=msg, info="warning", type="stop") 1569 1570 wx.PostEvent(self.parent, evt) … … 1920 1921 return None 1921 1922 try: 1922 from model_thread import Calc2D1923 1923 ## If a thread is already started, stop it 1924 1924 if (self.calc_2D is not None) and self.calc_2D.isrunning(): … … 1967 1967 return 1968 1968 try: 1969 from model_thread import Calc1D1970 1969 ## If a thread is already started, stop it 1971 1970 if (self.calc_1D is not None) and self.calc_1D.isrunning():
Note: See TracChangeset
for help on using the changeset viewer.