Changeset 386ffe1 in sasview for src/sas/fit/Fitting.py


Ignore:
Timestamp:
Feb 20, 2015 3:02:38 AM (9 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:
cda1cf8
Parents:
018582f
Message:

remove scipy levenburg marquardt and park from ui

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/fit/Fitting.py

    r79492222 r386ffe1  
    11""" 
    2 Class Fit contains ScipyFit and ParkFit methods declaration 
    3 allows to create instance of type ScipyFit or ParkFit to perform either 
    4 a park fit or a scipy fit. 
     2Class Fit contains fitting engine methods declaration 
    53""" 
    64 
    7 #from scipy import optimize 
    8 from sas.fit.ScipyFitting import ScipyFit 
    9 from sas.fit.ParkFitting import ParkFit 
    105from sas.fit.BumpsFitting import BumpsFit 
    116 
    127ENGINES={ 
    13     'scipy': ScipyFit, 
    14     'park': ParkFit, 
    158    'bumps': BumpsFit, 
    169} 
     
    2316        from sas.fit.Fitting import Fit 
    2417        fitter= Fit() 
    25         fitter.fit_engine('scipy') or fitter.fit_engine('park') 
     18        fitter.fit_engine('bumps') 
    2619        engine = fitter.returnEngine() 
    2720        engine.set_data(data,id) 
     
    3225         
    3326    """   
    34     def __init__(self, engine='scipy', *args, **kw): 
     27    def __init__(self, engine='bumps', *args, **kw): 
    3528        """ 
    3629        """ 
    37         #self._engine will contain an instance of ScipyFit or ParkFit 
    3830        self._engine = None 
    3931        self.fitter_id = None 
     
    6153        :param word: the keyword to select the fit type  
    6254         
    63         :raise: if the user does not enter 'scipy' or 'park', 
    64              a valueError is raised  
    65               
     55        :raise: KeyError if the user does not enter an available engine 
     56 
    6657        """ 
    6758        try: 
    6859            self._engine = ENGINES[word](*args, **kw) 
    6960        except KeyError, exc: 
    70             raise KeyError("fit engine should be one of scipy, park or bumps") 
     61            raise KeyError("fit engine should be bumps") 
     62            #raise KeyError("fit engine should be one of "+", ".join(sorted(ENGINES.keys()))) 
    7163 
    7264    def fit(self, msg_q=None, q=None, handler=None,  
     
    7567                        reset_flag=False): 
    7668        """Perform the fit """ 
    77         return self._engine.fit(msg_q=msg_q,  
     69        return self._engine.fit(msg_q=msg_q, 
    7870                                q=q, handler=handler, curr_thread=curr_thread, 
    7971                                ftol=ftol, reset_flag=reset_flag) 
Note: See TracChangeset for help on using the changeset viewer.