Changeset 1792311 in sasview
- Timestamp:
- Sep 8, 2014 8:14:40 AM (10 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:
- 66f21cd
- Parents:
- 72c969b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sans/fit/ScipyFitting.py
r8d074d9 r1792311 11 11 from sans.fit.AbstractFitEngine import FitEngine 12 12 from sans.fit.AbstractFitEngine import FResult 13 14 _SMALLVALUE = 1.0e-10 13 15 14 16 class SansAssembly: … … 189 191 raise RuntimeError, "No Assembly scheduled for Scipy fitting." 190 192 model = fitproblem[0].get_model() 193 pars = fitproblem[0].pars 191 194 if reset_flag: 192 195 # reset the initial value; useful for batch … … 203 206 204 207 # 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) 206 209 207 result = FResult(model=model.model, data=data, param_list= self.param_list)210 result = FResult(model=model.model, data=data, param_list=pars) 208 211 result.fitter_id = self.fitter_id 209 212 if handler is not None: 210 213 handler.set_result(result=result) 211 functor = SansAssembly(paramlist= self.param_list,214 functor = SansAssembly(paramlist=pars, 212 215 model=model, 213 216 data=data, … … 222 225 223 226 out, cov_x, _, mesg, success = optimize.leastsq(functor, 224 model.get_params( self.param_list),227 model.get_params(pars), 225 228 ftol=ftol, 226 229 full_output=1) … … 257 260 258 261 259 def _check_param_range(model, par am_list):262 def _check_param_range(model, pars): 260 263 """ 261 264 Check parameter range and set the initial value inside … … 265 268 """ 266 269 # loop through parameterset 267 for p in par am_list:270 for p in pars: 268 271 value = model.getParam(p) 269 272 low,high = model.details.setdefault(p,["",None,None])[1:3]
Note: See TracChangeset
for help on using the changeset viewer.