Changeset f668101 in sasview for src/sas/sascalc/fit
- Timestamp:
- Dec 7, 2016 9:16:33 AM (8 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, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- c6728e1
- Parents:
- 1cad8a4 (diff), 5231948 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Location:
- src/sas/sascalc/fit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/fit/BumpsFitting.py
r7988501 rf668101 4 4 import os 5 5 from datetime import timedelta, datetime 6 import traceback 6 7 7 8 import numpy … … 292 293 R.success = result['success'] 293 294 if R.success: 294 R.stderr = numpy.hstack((result['stderr'][fitted_index], 295 numpy.NaN*numpy.ones(len(fitness.computed_pars)))) 295 if result['stderr'] is None: 296 R.stderr = numpy.NaN*numpy.ones(len(param_list)) 297 else: 298 R.stderr = numpy.hstack((result['stderr'][fitted_index], 299 numpy.NaN*numpy.ones(len(fitness.computed_pars)))) 296 300 R.pvec = numpy.hstack((result['value'][fitted_index], 297 301 [p.value for p in fitness.computed_pars])) … … 305 309 R.uncertainty_state = result['uncertainty'] 306 310 all_results.append(R) 311 all_results[0].mesg = result['errors'] 307 312 308 313 if q is not None: … … 343 348 try: 344 349 best, fbest = fitdriver.fit() 345 except: 346 import traceback; traceback.print_exc() 347 raise 350 errors = [] 351 except Exception as exc: 352 best, fbest = None, numpy.NaN 353 errors = [str(exc), traceback.traceback.format_exc()] 348 354 finally: 349 355 mapper.stop_mapper(fitdriver.mapper) … … 355 361 356 362 success = best is not None 363 try: 364 stderr = fitdriver.stderr() if success else None 365 except Exception as exc: 366 errors.append(str(exc)) 367 errors.append(traceback.format_exc()) 368 stderr = None 357 369 return { 358 370 'value': best if success else None, 359 'stderr': fitdriver.stderr() if success else None,371 'stderr': stderr, 360 372 'success': success, 361 373 'convergence': convergence, 362 374 'uncertainty': getattr(fitdriver.fitter, 'state', None), 375 'errors': '\n'.join(errors), 363 376 } 364 377 -
src/sas/sascalc/fit/AbstractFitEngine.py
rfc18690 r7988501 131 131 a way to get residuals from data. 132 132 """ 133 def __init__(self, x, y, dx=None, dy=None, smearer=None, data=None ):133 def __init__(self, x, y, dx=None, dy=None, smearer=None, data=None, lam=None, dlam=None): 134 134 """ 135 135 :param smearer: is an object of class QSmearer or SlitSmearer … … 152 152 153 153 """ 154 Data1D.__init__(self, x=x, y=y, dx=dx, dy=dy )154 Data1D.__init__(self, x=x, y=y, dx=dx, dy=dy, lam=lam,dlam=dlam) 155 155 self.num_points = len(x) 156 156 self.sas_data = data
Note: See TracChangeset
for help on using the changeset viewer.