Changeset 235d766 in sasview
- Timestamp:
- Feb 8, 2018 8:37:28 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:
- 731efec
- Parents:
- 725d9c06
- git-author:
- Piotr Rozyczko <rozyczko@…> (02/08/18 08:32:10)
- git-committer:
- Piotr Rozyczko <rozyczko@…> (02/08/18 08:37:28)
- Location:
- src/sas/qtgui
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/ConstraintWidget.py
ra90c9c5 r235d766 294 294 self.parent.fittingStoppedSignal.emit(self.getTabsForFit()) 295 295 296 # Assure the fitting succeeded 297 if result is None or not result: 298 msg = "Fitting failed. Please ensure correctness of chosen constraints." 299 self.parent.communicate.statusBarUpdateSignal.emit(msg) 300 return 301 296 302 # get the elapsed time 297 303 elapsed = result[1] … … 553 559 554 560 # Check if any constraints present in tab 555 constraint_names = fit_page.getCo nstraintsForModel()561 constraint_names = fit_page.getComplexConstraintsForModel() 556 562 constraints = fit_page.getConstraintObjectsForModel() 557 563 if not constraints: -
src/sas/qtgui/Perspectives/Fitting/FitThread.py
- Property mode changed from 100755 to 100644
rb3e8629 r235d766 95 95 # print "ERROR IN FIT THREAD: ", traceback.format_exc() 96 96 if self.handler is not None: 97 self.handler.error(msg=traceback.format_exc()) 97 self.handler.error(msg=str(ex)) 98 self.completefn(None) 99 else: 100 return(None) 98 101 99 102 -
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r14ec91c5 r235d766 24 24 import sas.qtgui.Utilities.GuiUtils as GuiUtils 25 25 import sas.qtgui.Utilities.LocalConfig as LocalConfig 26 26 from sas.qtgui.Utilities.GridPanel import BatchOutputPanel 27 27 from sas.qtgui.Utilities.CategoryInstaller import CategoryInstaller 28 28 from sas.qtgui.Plotting.PlotterData import Data1D … … 657 657 param = self._model_model.item(row, 0).text() 658 658 value = self._model_model.item(row, 1).text() 659 min = self._model_model.item(row, min_col).text()660 max = self._model_model.item(row, max_col).text()659 min_t = self._model_model.item(row, min_col).text() 660 max_t = self._model_model.item(row, max_col).text() 661 661 # Create a Constraint object 662 constraint = Constraint(param=param, value=value, min=min , max=max, func=value)662 constraint = Constraint(param=param, value=value, min=min_t, max=max_t) 663 663 # Create a new item and add the Constraint object as a child 664 664 item = QtGui.QStandardItem() 665 665 item.setData(constraint) 666 666 self._model_model.item(row, 1).setChild(0, item) 667 # Assumed correctness from the validator 668 value = float(value) 669 # BUMPS calculates log(max-min) without any checks, so let's assign minor range 670 min_v = value - (value/10000.0) 671 max_v = value + (value/10000.0) 667 672 # Set min/max to the value constrained 668 self._model_model.item(row, min_col).setText( value)669 self._model_model.item(row, max_col).setText( value)673 self._model_model.item(row, min_col).setText(str(min_v)) 674 self._model_model.item(row, max_col).setText(str(max_v)) 670 675 self.constraintAddedSignal.emit([row]) 671 676 # Show visual hints for the constraint … … 735 740 if item.hasChildren(): 736 741 c = item.child(0).data() 737 if isinstance(c, Constraint) and c.func:742 if isinstance(c, Constraint): 738 743 return True 739 744 return False … … 742 747 """ 743 748 Finds out if row of the main model has an active constraint child 749 """ 750 item = self._model_model.item(row,1) 751 if item.hasChildren(): 752 c = item.child(0).data() 753 if isinstance(c, Constraint) and c.active: 754 return True 755 return False 756 757 def rowHasActiveComplexConstraint(self, row): 758 """ 759 Finds out if row of the main model has an active, nontrivial constraint child 744 760 """ 745 761 item = self._model_model.item(row,1) … … 786 802 model_name = self.kernel_module.name 787 803 param_number = self._model_model.rowCount() 788 def preamble(s):789 func = self._model_model.item(s, 1).child(0).data().func790 value = self._model_model.item(s, 1).child(0).data().value791 if func == value:792 return ""793 794 return model_name + "."795 804 params = [(self._model_model.item(s, 0).text(), 796 #preamble(s) +self._model_model.item(s, 1).child(0).data().func)797 805 self._model_model.item(s, 1).child(0).data().func) 798 806 for s in range(param_number) if self.rowHasActiveConstraint(s)] 807 return params 808 809 def getComplexConstraintsForModel(self): 810 """ 811 Return a list of tuples. Each tuple contains constraints mapped as 812 ('constrained parameter', 'function to constrain') 813 e.g. [('sld','5*sld_solvent')]. 814 Only for constraints with defined VALUE 815 """ 816 model_name = self.kernel_module.name 817 param_number = self._model_model.rowCount() 818 params = [(self._model_model.item(s, 0).text(), 819 self._model_model.item(s, 1).child(0).data().func) 820 for s in range(param_number) if self.rowHasActiveComplexConstraint(s)] 799 821 return params 800 822 … … 1147 1169 self.setFittingStopped() 1148 1170 1149 print ("BATCH FITTING FINISHED")1150 # Add the Qt version of wx.aui.AuiNotebook and populate it1151 pass1171 # Show the grid panel 1172 grid_window = BatchOutputPanel(parent=self, output_data=result[0]) 1173 grid_window.show() 1152 1174 1153 1175 def fitComplete(self, result): … … 1222 1244 smearing, accuracy, smearing_min, smearing_max = self.smearing_widget.state() 1223 1245 1224 constraints = self.getCo nstraintsForModel()1246 constraints = self.getComplexConstraintsForModel() 1225 1247 smearer = None 1226 1248 handler = None -
src/sas/qtgui/Utilities/LocalConfig.py
r14ec91c5 r235d766 133 133 134 134 # Default threading model 135 USING_TWISTED = True135 USING_TWISTED = False 136 136 137 137 # Time out for updating sasview
Note: See TracChangeset
for help on using the changeset viewer.