Changeset 1792311 in sasview


Ignore:
Timestamp:
Sep 8, 2014 8:14:40 AM (6 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:
66f21cd
Parents:
72c969b
Message:

fix broken scipy tests

File:
1 edited

Legend:

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

    r8d074d9 r1792311  
    1111from sans.fit.AbstractFitEngine import FitEngine 
    1212from sans.fit.AbstractFitEngine import FResult 
     13 
     14_SMALLVALUE = 1.0e-10 
    1315 
    1416class SansAssembly: 
     
    189191            raise RuntimeError, "No Assembly scheduled for Scipy fitting." 
    190192        model = fitproblem[0].get_model() 
     193        pars = fitproblem[0].pars 
    191194        if reset_flag: 
    192195            # reset the initial value; useful for batch 
     
    203206         
    204207        # Check the initial value if it is within range 
    205         _check_param_range(model.model, self.param_list) 
     208        _check_param_range(model.model, pars) 
    206209         
    207         result = FResult(model=model.model, data=data, param_list=self.param_list) 
     210        result = FResult(model=model.model, data=data, param_list=pars) 
    208211        result.fitter_id = self.fitter_id 
    209212        if handler is not None: 
    210213            handler.set_result(result=result) 
    211         functor = SansAssembly(paramlist=self.param_list, 
     214        functor = SansAssembly(paramlist=pars, 
    212215                               model=model, 
    213216                               data=data, 
     
    222225             
    223226            out, cov_x, _, mesg, success = optimize.leastsq(functor, 
    224                                             model.get_params(self.param_list), 
     227                                            model.get_params(pars), 
    225228                                            ftol=ftol, 
    226229                                            full_output=1) 
     
    257260 
    258261         
    259 def _check_param_range(model, param_list): 
     262def _check_param_range(model, pars): 
    260263    """ 
    261264    Check parameter range and set the initial value inside 
     
    265268    """ 
    266269    # loop through parameterset 
    267     for p in param_list: 
     270    for p in pars: 
    268271        value = model.getParam(p) 
    269272        low,high = model.details.setdefault(p,["",None,None])[1:3] 
Note: See TracChangeset for help on using the changeset viewer.