Ignore:
Timestamp:
May 19, 2014 5:30:19 PM (10 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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.