Changeset 2a0f33f in sasview for src/sas/sasgui/perspectives/fitting


Ignore:
Timestamp:
Jun 20, 2017 2:01:33 PM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
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:
00f7ff1
Parents:
78312f7
Message:

move fit pagestate from gui to calc

Location:
src/sas/sasgui/perspectives/fitting
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/basepage.py

    r78312f7 r2a0f33f  
    2323from sas.sascalc.dataloader.data_info import Detector 
    2424from sas.sascalc.dataloader.data_info import Source 
     25from sas.sascalc.fit.pagestate import PageState 
    2526 
    2627from sas.sasgui.guiframe.panel_base import PanelBase 
     
    3738from sas.sasgui.guiframe.documentation_window import DocumentationWindow 
    3839 
    39 from sas.sasgui.perspectives.fitting.pagestate import PageState 
    4040from sas.sasgui.perspectives.fitting.report_dialog import ReportDialog 
    4141 
  • src/sas/sasgui/perspectives/fitting/fitting.py

    ra534432 r2a0f33f  
    2424 
    2525from sas.sascalc.dataloader.loader import Loader 
     26from sas.sascalc.fit.BumpsFitting import BumpsFit as Fit 
     27from sas.sascalc.fit.pagestate import Reader 
     28 
    2629from sas.sasgui.guiframe.dataFitting import Data2D 
    2730from sas.sasgui.guiframe.dataFitting import Data1D 
     
    3437from sas.sasgui.guiframe.plugin_base import PluginBase 
    3538from sas.sasgui.guiframe.data_processor import BatchCell 
    36 from sas.sascalc.fit.BumpsFitting import BumpsFit as Fit 
    3739from sas.sasgui.perspectives.fitting.console import ConsoleUpdate 
    3840from sas.sasgui.perspectives.fitting.fitproblem import FitProblemDictionary 
     
    361363                                   'Add a new model function') 
    362364        wx.EVT_MENU(owner, wx_id, self.make_new_model) 
    363          
     365 
    364366        wx_id = wx.NewId() 
    365367        self.edit_model_menu.Append(wx_id, 'Sum|Multi(p1, p2)', 
     
    383385          '(Re)Load all models present in user plugin_models folder') 
    384386        wx.EVT_MENU(owner, wx_id, self.load_plugin_models) 
    385                  
     387 
    386388    def set_edit_menu_helper(self, owner=None, menu=None): 
    387389        """ 
     
    17341736            @param unsmeared_error: data error, rescaled to unsmeared model 
    17351737        """ 
    1736              
    1737         number_finite = np.count_nonzero(np.isfinite(y))  
     1738 
     1739        number_finite = np.count_nonzero(np.isfinite(y)) 
    17381740        np.nan_to_num(y) 
    17391741        new_plot = self.create_theory_1D(x, y, page_id, model, data, state, 
     
    17941796            msg = "Computing Error: Model did not return any finite value." 
    17951797            wx.PostEvent(self.parent, StatusEvent(status = msg, info="error")) 
    1796         else:                  
     1798        else: 
    17971799            msg = "Computation  completed!" 
    17981800            if number_finite != y.size: 
     
    18241826        that can be plot. 
    18251827        """ 
    1826         number_finite = np.count_nonzero(np.isfinite(image))  
     1828        number_finite = np.count_nonzero(np.isfinite(image)) 
    18271829        np.nan_to_num(image) 
    18281830        new_plot = Data2D(image=image, err_image=data.err_data) 
     
    19271929                ## and may be the cause of other noted instabilities 
    19281930                ## 
    1929                 ##    -PDB August 12, 2014  
     1931                ##    -PDB August 12, 2014 
    19301932                while self.calc_2D.isrunning(): 
    19311933                    time.sleep(0.1) 
     
    19691971            if (self.calc_1D is not None) and self.calc_1D.isrunning(): 
    19701972                self.calc_1D.stop() 
    1971                 ## stop just raises the flag -- the thread is supposed to  
     1973                ## stop just raises the flag -- the thread is supposed to 
    19721974                ## then kill itself but cannot.  Paul Kienzle came up with 
    19731975                ## this fix to prevent threads from stepping on each other 
     
    19811983                ## a request to stop the computation. 
    19821984                ## It seems thus that the whole thread approach used here 
    1983                 ## May need rethinking   
     1985                ## May need rethinking 
    19841986                ## 
    19851987                ##    -PDB August 12, 2014 
     
    21462148            residuals.dxw = None 
    21472149            residuals.ytransform = 'y' 
    2148             # For latter scale changes  
     2150            # For latter scale changes 
    21492151            residuals.xaxis('\\rm{Q} ', 'A^{-1}') 
    21502152            residuals.yaxis('\\rm{Residuals} ', 'normalized') 
Note: See TracChangeset for help on using the changeset viewer.