Changeset 386ffe1 in sasview for src/sas/fit/Fitting.py
- Timestamp:
- Feb 20, 2015 3:02:38 AM (9 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/fit/Fitting.py
r79492222 r386ffe1 1 1 """ 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. 2 Class Fit contains fitting engine methods declaration 5 3 """ 6 4 7 #from scipy import optimize8 from sas.fit.ScipyFitting import ScipyFit9 from sas.fit.ParkFitting import ParkFit10 5 from sas.fit.BumpsFitting import BumpsFit 11 6 12 7 ENGINES={ 13 'scipy': ScipyFit,14 'park': ParkFit,15 8 'bumps': BumpsFit, 16 9 } … … 23 16 from sas.fit.Fitting import Fit 24 17 fitter= Fit() 25 fitter.fit_engine(' scipy') or fitter.fit_engine('park')18 fitter.fit_engine('bumps') 26 19 engine = fitter.returnEngine() 27 20 engine.set_data(data,id) … … 32 25 33 26 """ 34 def __init__(self, engine=' scipy', *args, **kw):27 def __init__(self, engine='bumps', *args, **kw): 35 28 """ 36 29 """ 37 #self._engine will contain an instance of ScipyFit or ParkFit38 30 self._engine = None 39 31 self.fitter_id = None … … 61 53 :param word: the keyword to select the fit type 62 54 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 66 57 """ 67 58 try: 68 59 self._engine = ENGINES[word](*args, **kw) 69 60 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()))) 71 63 72 64 def fit(self, msg_q=None, q=None, handler=None, … … 75 67 reset_flag=False): 76 68 """Perform the fit """ 77 return self._engine.fit(msg_q=msg_q, 69 return self._engine.fit(msg_q=msg_q, 78 70 q=q, handler=handler, curr_thread=curr_thread, 79 71 ftol=ftol, reset_flag=reset_flag)
Note: See TracChangeset
for help on using the changeset viewer.