Changeset 6fe5100 in sasview for src/sans/fit/Fitting.py


Ignore:
Timestamp:
Apr 6, 2014 5:29:59 AM (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:
95d58d3
Parents:
960fdbb
Message:

Bumps first pass. Fitting works but no pretty pictures

File:
1 edited

Legend:

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

    r5777106 r6fe5100  
    88from sans.fit.ScipyFitting import ScipyFit 
    99from sans.fit.ParkFitting import ParkFit 
     10from sans.fit.BumpsFitting import BumpsFit 
    1011 
     12ENGINES={ 
     13    'scipy': ScipyFit, 
     14    'park': ParkFit, 
     15    'bumps': BumpsFit, 
     16} 
    1117 
    1218class Fit(object): 
     
    5965              
    6066        """ 
    61         if word == "scipy": 
    62             self._engine = ScipyFit() 
    63         elif word == "park": 
    64             self._engine = ParkFit() 
    65         else: 
    66             raise ValueError, "enter the keyword scipy or park" 
     67        try: 
     68            self._engine = ENGINES[word]() 
     69        except KeyError, exc: 
     70            raise KeyError("fit engine should be one of scipy, park or bumps") 
    6771 
    6872    def fit(self, msg_q=None, q=None, handler=None,  
Note: See TracChangeset for help on using the changeset viewer.