- Timestamp:
- May 22, 2017 7:25:30 AM (7 years ago)
- Branches:
- 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
- Children:
- c416a17
- Parents:
- fd1ae6d1
- Location:
- src/sas/qtgui/Perspectives/Fitting
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FitPage.py
r6066a3f r6964d44 30 30 self.data = None 31 31 self.parameters_to_fit = [] 32 self.kernel_module = None 32 33 33 34 # QModels -
src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py
rfd1ae6d1 r6964d44 275 275 residuals.y = y 276 276 277 #try:278 # y = (fn - gn)/en279 # residuals.y = -y280 #except ValueError:281 # msg = "ResidualPlot Error: different number of data points in theory"282 # print msg283 # y = (fn - gn[index][0]) / en284 # residuals.y = y285 277 residuals.x = current_data.x[index][0] 286 278 residuals.dy = numpy.ones(len(residuals.y)) … … 359 351 return residuals 360 352 361 362 353 def binary_encode(i, digits): 363 354 return [i >> d & 1 for d in xrange(digits)] -
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
rfd1ae6d1 r6964d44 819 819 weight = FittingUtilities.getWeight(data=data, is2d=self.is2D, flag=self.weighting) 820 820 update_module = data.err_data if self.is2D else data.dy 821 # Overwrite relevant values in data 821 822 update_module = weight 822 823 … … 873 874 # (Re)-create headers 874 875 FittingUtilities.addHeadersToModel(self._model_model) 876 self.lstParams.header().setFont(self.boldFont) 875 877 876 878 # Update Q Ranges … … 888 890 889 891 # Explicitly add scale and background with default values 892 temp_undo_state = self.undo_supported 893 self.undo_supported = False 890 894 self.addScaleToModel(self._model_model) 891 895 self.addBackgroundToModel(self._model_model) 896 self.undo_supported = temp_undo_state 892 897 893 898 # Update the QModel … … 920 925 self.checkboxSelected(item) 921 926 self.cmdFit.setEnabled(self.parameters_to_fit != [] and self.logic.data_is_loaded) 927 # Update state stack 928 self.updateUndo() 922 929 return 923 930 … … 1070 1077 calc_thread = threads.deferToThread(method.compute) 1071 1078 calc_thread.addCallback(self.methodCompleteForData()) 1079 calc_thread.addErrback(self.calculateDataFailed()) 1080 1081 def calculateDataFailed(self): 1082 """ 1083 """ 1084 print "Calculate Data failed." 1072 1085 1073 1086 def complete1D(self, return_data): … … 1093 1106 # Create a new index for holding data 1094 1107 fitted_data.symbol = "Line" 1108 1109 # Modify fitted_data with weighting 1110 self.addWeightingToData(fitted_data) 1111 1095 1112 self.createNewIndex(fitted_data) 1096 1113 # Calculate difference between return_data and logic.data … … 1308 1325 fp.chi2 = self.chi2 1309 1326 fp.parameters_to_fit = self.parameters_to_fit 1327 fp.kernel_module = self.kernel_module 1310 1328 1311 1329 # Options tab -
src/sas/qtgui/Perspectives/Fitting/ModelThread.py
rdc5ef15 r6964d44 229 229 elapsed = time.time() - self.starttime 230 230 231 #self.complete(x=self.data.x[index], y=output[index],232 # page_id=self.page_id,233 # state=self.state,234 # weight=self.weight,235 # fid=self.fid,236 # toggle_mode_on=self.toggle_mode_on,237 # elapsed=elapsed, index=index, model=self.model,238 # data=self.data,239 # update_chisqr=self.update_chisqr,240 # source=self.source)241 231 return (self.data.x[index], output[index], 242 232 self.page_id, -
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FitPageTest.py
- Property mode changed from 100755 to 100644
r672b8ab r6964d44 30 30 self.assertEqual(self.page.filename, "") 31 31 self.assertIsNone(self.page.data) 32 self.assertIsNone(self.page.kernel_module) 32 33 self.assertEqual(self.page.parameters_to_fit, []) 33 34
Note: See TracChangeset
for help on using the changeset viewer.