Changeset 386ffe1 in sasview for src/sas/fit


Ignore:
Timestamp:
Feb 20, 2015 5: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

Location:
src/sas/fit
Files:
5 edited

Legend:

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

    rfd5ac0d r386ffe1  
    1010_SMALLVALUE = 1.0e-10 
    1111 
    12 # Note: duplicated from park 
    1312class FitHandler(object): 
    1413    """ 
     
    6968    def __init__(self, sas_model, sas_data=None, **kw): 
    7069        """ 
    71         :param sas_model: the sas model to wrap using park interface 
     70        :param sas_model: the sas model to wrap for fitting 
    7271 
    7372        """ 
     
    10099    def eval(self, x): 
    101100        """ 
    102             Override eval method of park model. 
     101            Override eval method of model. 
    103102 
    104103            :param x: the x value used to compute a function 
     
    394393    def __init__(self): 
    395394        """ 
    396         Base class for scipy and park fit engine 
     395        Base class for the fit engine 
    397396        """ 
    398397        #Dictionnary of fitArrange element (fit problems) 
  • src/sas/fit/BumpsFitting.py

    rfd5ac0d r386ffe1  
    1010from bumps.mapper import SerialMapper, MPMapper 
    1111from bumps import parameter 
     12 
     13# TODO: remove globals from interface to bumps options! 
     14# Default bumps to use the levenberg-marquardt optimizer 
    1215from bumps.fitproblem import FitProblem 
     16fitters.FIT_DEFAULT = 'lm' 
    1317 
    1418from sas.fit.AbstractFitEngine import FitEngine 
  • 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) 
  • src/sas/fit/ParkFitting.py

    rfd5ac0d r386ffe1  
    77to perform a simple fit with park optimizer. 
    88""" 
     9 
     10_ = ''' 
    911#import time 
    1012import numpy 
     
    615617            return q 
    616618        return result_list 
    617         
     619 
     620''' 
  • src/sas/fit/ScipyFitting.py

    ra10364b r386ffe1  
    44simple fit with scipy optimizer. 
    55""" 
     6_ = ''' 
    67import sys 
    78import copy 
     
    265266    if it is out of range. 
    266267 
    267     : model: park model object 
     268    : model: model object 
    268269    """ 
    269270    # loop through parameterset 
     
    306307#    return call_result 
    307308 
    308        
     309 
     310''' 
Note: See TracChangeset for help on using the changeset viewer.