Changeset f845454 in sasview for src/sas/sascalc/fit/BumpsFitting.py
- Timestamp:
- Dec 19, 2016 1:52:12 PM (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:
- b61bd57
- Parents:
- 99f3e053 (diff), 50f1477 (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. - git-author:
- Jeff Krzywon <krzywon@…> (12/19/16 13:52:12)
- git-committer:
- GitHub <noreply@…> (12/19/16 13:52:12)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/fit/BumpsFitting.py
rb699768 r345e7e4 4 4 import os 5 5 from datetime import timedelta, datetime 6 import traceback 6 7 7 8 import numpy … … 293 294 R.success = result['success'] 294 295 if R.success: 295 R.stderr = numpy.hstack((result['stderr'][fitted_index], 296 numpy.NaN*numpy.ones(len(fitness.computed_pars)))) 296 if result['stderr'] is None: 297 R.stderr = numpy.NaN*numpy.ones(len(param_list)) 298 else: 299 R.stderr = numpy.hstack((result['stderr'][fitted_index], 300 numpy.NaN*numpy.ones(len(fitness.computed_pars)))) 297 301 R.pvec = numpy.hstack((result['value'][fitted_index], 298 302 [p.value for p in fitness.computed_pars])) … … 306 310 R.uncertainty_state = result['uncertainty'] 307 311 all_results.append(R) 312 all_results[0].mesg = result['errors'] 308 313 309 314 if q is not None: … … 344 349 try: 345 350 best, fbest = fitdriver.fit() 346 except: 347 import traceback; traceback.print_exc() 348 raise 351 errors = [] 352 except Exception as exc: 353 best, fbest = None, numpy.NaN 354 errors = [str(exc), traceback.traceback.format_exc()] 349 355 finally: 350 356 mapper.stop_mapper(fitdriver.mapper) … … 356 362 357 363 success = best is not None 364 try: 365 stderr = fitdriver.stderr() if success else None 366 except Exception as exc: 367 errors.append(str(exc)) 368 errors.append(traceback.format_exc()) 369 stderr = None 358 370 return { 359 371 'value': best if success else None, 360 'stderr': fitdriver.stderr() if success else None,372 'stderr': stderr, 361 373 'success': success, 362 374 'convergence': convergence, 363 375 'uncertainty': getattr(fitdriver.fitter, 'state', None), 376 'errors': '\n'.join(errors), 364 377 } 365 378
Note: See TracChangeset
for help on using the changeset viewer.