Changeset 8aa5788 in sasview for fittingview/src/sans
- Timestamp:
- Sep 12, 2011 12:50:36 PM (13 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:
- 7afcae8
- Parents:
- dc79cfc
- Location:
- fittingview/src/sans/perspectives/fitting
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
fittingview/src/sans/perspectives/fitting/fit_thread.py
rf7f6886 r8aa5788 20 20 page_id, 21 21 handler, 22 batch_result, 22 23 pars=None, 23 24 completefn = None, … … 33 34 self.fitter = fn 34 35 self.pars = pars 36 self.batch_result = batch_result 35 37 self.page_id = page_id 36 38 self.starttime = 0 … … 75 77 #self.handler.starting_fit() 76 78 self.complete(result= result, 79 batch_result=self.batch_result, 77 80 page_id=self.page_id, 78 81 pars = self.pars) -
fittingview/src/sans/perspectives/fitting/fitproblem.py
rf7ef313 r8aa5788 432 432 if not self.smearer_enable: 433 433 return None 434 if self.smearer_computer_value is None and \435 self.smearer_compute_count > 1:434 #if self.smearer_computer_value is None and \ 435 # self.smearer_compute_count > 1: 436 436 #smeari_selection should be call only once per fitproblem 437 437 self.smearer_computer_value = smear_selection(self.fit_data, 438 438 self.model) 439 439 self.smearer_compute_count += 1 440 440 return self.smearer_computer_value 441 441 … … 450 450 return self.name_per_page 451 451 452 def set_model(self, model):452 def set_model(self, model): 453 453 """ 454 454 associates each model with its new created name -
fittingview/src/sans/perspectives/fitting/fitting.py
r6446f87 r8aa5788 682 682 list_page_id = [] 683 683 fit_id = 0 684 batch_result = {} 684 685 for page_id, value in self.page_finder.iteritems(): 685 686 # For simulfit (uid give with None), do for-loop … … 701 702 if sim_fitter is None: 702 703 fitter = Fit(self._fit_engine) 703 self._fit_helper(fitproblem, pars, fitter, fit_id) 704 self._fit_helper(fitproblem, pars, fitter, 705 fit_id, batch_result) 704 706 fitter_list.append(fitter) 705 707 else: 706 708 fitter = sim_fitter 707 self._fit_helper(fitproblem, pars, fitter, fit_id) 709 self._fit_helper(fitproblem, pars, fitter, 710 fit_id, batch_result) 708 711 fit_id += 1 709 712 list_page_id.append(page_id) … … 731 734 fn=fitter_list, 732 735 pars=pars, 736 batch_result=batch_result, 733 737 page_id=list_page_id, 734 738 completefn=self._single_fit_completed, … … 739 743 calc_fit = FitThread(handler=handler, 740 744 fn=fitter_list, 745 batch_result=batch_result, 741 746 page_id=list_page_id, 742 747 updatefn=handler.update_fit, … … 897 902 self.page_finder[uid].schedule_tofit(value) 898 903 899 def _fit_helper(self, fitproblem, pars, fitter, fit_id ):904 def _fit_helper(self, fitproblem, pars, fitter, fit_id, batch_result): 900 905 """ 901 906 Create and set fit engine with series of data and model … … 917 922 listOfConstraint.append((item[0],item[1])) 918 923 fitter.set_model(model, fit_id, pars, constraints=listOfConstraint) 924 if "Data" not in batch_result.keys(): 925 batch_result["Data"] = [] 926 batch_result["Data"].append(data.name) 919 927 fitter.set_data(data=data, id=fit_id, smearer=smearer, qmin=qmin, 920 928 qmax=qmax) … … 947 955 948 956 def _batch_single_fit_complete_helper(self, result, pars, page_id, 949 elapsed=None):957 batch_result, elapsed=None): 950 958 """ 951 959 Display fit result in batch … … 986 994 cpage._on_fit_complete() 987 995 988 def _single_fit_completed(self, result, pars, page_id, elapsed=None): 996 def _single_fit_completed(self, result, pars, page_id, 997 batch_result, elapsed=None): 989 998 """ 990 999 Display fit result on one page of the notebook. … … 999 1008 if self.batch_on: 1000 1009 wx.CallAfter(self._batch_single_fit_complete_helper, 1001 result, pars, page_id, elapsed=None)1010 result, pars, page_id, batch_result, elapsed) 1002 1011 return 1003 1012 else: … … 1049 1058 raise 1050 1059 1051 def _simul_fit_completed(self, result, page_id, pars=None, elapsed=None): 1060 def _simul_fit_completed(self, result, page_id, batch_result, pars=None, 1061 elapsed=None): 1052 1062 """ 1053 1063 Display result of the fit on related panel(s).
Note: See TracChangeset
for help on using the changeset viewer.