Changeset eff93b8 in sasview for src


Ignore:
Timestamp:
May 19, 2014 5:30:19 PM (11 years ago)
Author:
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, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
85a3b46
Parents:
4a0dc427
Message:

change default fit engine to bumps:levenberg-marquardt

Location:
src/sans
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/sans/fit/BumpsFitting.py

    r4a0dc427 reff93b8  
    196196            handler.update_fit(last=True) 
    197197 
    198         # TODO: shouldn't reference internal parameters 
     198        # TODO: shouldn't reference internal parameters of fit problem 
    199199        varying = problem._parameters 
    200200        # collect the results 
     
    208208            R.residuals = fitness.residuals() 
    209209            R.fitter_id = self.fitter_id 
     210            # TODO: should scale stderr by sqrt(chisq/DOF) if dy is unknown 
    210211            R.stderr = result['stderr'][fitted_index] 
    211212            R.pvec = result['value'][fitted_index] 
  • src/sans/perspectives/fitting/fitpanel.py

    rb6a181b reff93b8  
    6464        self.sim_page = None 
    6565        self.batch_page = None 
    66         self.fit_engine_type = "scipy" 
     66        self.fit_engine_type = "bumps" 
    6767        ## get the state of a page 
    6868        self.Bind(basepage.EVT_PAGE_INFO, self._onGetstate) 
  • src/sans/perspectives/fitting/fitting.py

    r4e9f227 reff93b8  
    4545from sans.guiframe.gui_manager import MDIFrame 
    4646 
     47# TODO: remove globals from interface to bumps options! 
     48# Default bumps to use the levenberg-marquardt optimizer 
     49import bumps.fitters 
     50bumps.fitters.FIT_DEFAULT = 'lm' 
     51 
    4752MAX_NBR_DATA = 4 
    4853SANS_F_TOL = 5e-05 
     
    8085        # Start with a good default 
    8186        self.elapsed = 0.022 
    82         # the type of optimizer selected, park or scipy 
    83         self.fitter = None 
    8487        self.fit_panel = None 
    8588        #let fit ready 
     
    9093        self.closed_page_dict = {} 
    9194        ## Fit engine 
    92         self._fit_engine = 'scipy' 
     95        self._fit_engine = 'bumps' 
    9396        self._gui_engine = None 
    9497        ## Relative error desired in the sum of squares (float); scipy only 
     
    206209        wx.EVT_MENU(owner, self.bumps_id, self._onset_engine_bumps) 
    207210         
    208         self.menu1.FindItemById(self.scipy_id).Check(True) 
    209         self.menu1.FindItemById(self.park_id).Check(False) 
    210         self.menu1.FindItemById(self.bumps_id).Check(False) 
     211        self.menu1.FindItemById(self.scipy_id).Check(self._fit_engine=="scipy") 
     212        self.menu1.FindItemById(self.park_id).Check(self._fit_engine=="park") 
     213        self.menu1.FindItemById(self.bumps_id).Check(self._fit_engine=="bumps") 
    211214        self.menu1.AppendSeparator() 
    212215        self.id_tol = wx.NewId() 
     
    986989            if value.get_scheduled() == 1: 
    987990                fitproblem_count += 1 
    988         self._gui_engine = self._return_engine_type() 
     991        # Remember the user selected fit engine before the fit.  Simultaneous 
     992        # fitting may change the selected engine, so it needs to be restored 
     993        # when the fit is complete. 
     994        self._gui_engine = self._fit_engine 
    989995        self.fitproblem_count = fitproblem_count 
    990996        if self._fit_engine in ("park","bumps"): 
     
    17511757                break 
    17521758     
    1753     def _return_engine_type(self): 
    1754         """ 
    1755         return the current type of engine 
    1756         """ 
    1757         return self._fit_engine 
    1758       
    17591759    def _on_change_engine(self, engine='park'): 
    17601760        """ 
Note: See TracChangeset for help on using the changeset viewer.