Changeset c8536d6c in sasview for src/sas/qtgui/Perspectives
- Timestamp:
- Sep 8, 2018 9:32:23 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- 35e36fd, c0de493
- Parents:
- 3090270 (diff), 01b4877 (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:
- Torin Cooper-Bennun <40573959+tcbennun@…> (09/08/18 09:32:23)
- git-committer:
- GitHub <noreply@…> (09/08/18 09:32:23)
- Location:
- src/sas/qtgui/Perspectives/Fitting
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py
rb69b549 r01b4877 167 167 return rows 168 168 169 def addSimpleParametersToModel(parameters, is2D, parameters_original=None, model=None, view=None ):169 def addSimpleParametersToModel(parameters, is2D, parameters_original=None, model=None, view=None, row_num=None): 170 170 """ 171 171 Update local ModelModel with sasmodel parameters (non-dispersed, non-magnetic) … … 216 216 # Append to the model and use the combobox, if required 217 217 if None not in (model, view): 218 model.appendRow(row) 218 if row_num is None: 219 model.appendRow(row) 220 else: 221 model.insertRow(row_num, row) 222 row_num += 1 223 219 224 if cbox: 220 225 view.setIndexWidget(item2.index(), cbox) 226 221 227 rows.append(row) 222 228 -
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r3090270 rc8536d6c 2102 2102 return 2103 2103 2104 product_params = None 2105 2104 2106 if self.kernel_module is None: 2105 2107 # Structure factor is the only selected model; build it and show all its params … … 2107 2109 s_params = self.kernel_module._model_info.parameters 2108 2110 s_params_orig = s_params 2109 2110 2111 else: 2111 2112 s_kernel = self.models[structure_factor]() … … 2124 2125 if "radius_effective_mode" in all_param_names: 2125 2126 # Show all parameters 2127 # In this case, radius_effective is NOT pruned by sasmodels.product 2126 2128 s_params = modelinfo.ParameterTable(all_params[p_pars_len:p_pars_len+s_pars_len]) 2127 2129 s_params_orig = modelinfo.ParameterTable(s_kernel._model_info.parameters.kernel_parameters) 2130 product_params = modelinfo.ParameterTable( 2131 self.kernel_module._model_info.parameters.kernel_parameters[p_pars_len+s_pars_len:]) 2128 2132 else: 2129 2133 # Ensure radius_effective is not displayed 2130 2134 s_params_orig = modelinfo.ParameterTable(s_kernel._model_info.parameters.kernel_parameters[1:]) 2131 2135 if "radius_effective" in all_param_names: 2136 # In this case, radius_effective is NOT pruned by sasmodels.product 2132 2137 s_params = modelinfo.ParameterTable(all_params[p_pars_len+1:p_pars_len+s_pars_len]) 2138 product_params = modelinfo.ParameterTable( 2139 self.kernel_module._model_info.parameters.kernel_parameters[p_pars_len+s_pars_len:]) 2133 2140 else: 2141 # In this case, radius_effective is pruned by sasmodels.product 2134 2142 s_params = modelinfo.ParameterTable(all_params[p_pars_len:p_pars_len+s_pars_len-1]) 2143 product_params = modelinfo.ParameterTable( 2144 self.kernel_module._model_info.parameters.kernel_parameters[p_pars_len+s_pars_len-1:]) 2135 2145 2136 2146 # Add heading row … … 2140 2150 # Any renamed parameters are stored as data in the relevant item, for later handling 2141 2151 FittingUtilities.addSimpleParametersToModel( 2142 s_params, 2143 self.is2D, 2144 s_params_orig, 2145 self._model_model, 2146 self.lstParams) 2152 parameters=s_params, 2153 is2D=self.is2D, 2154 parameters_original=s_params_orig, 2155 model=self._model_model, 2156 view=self.lstParams) 2157 2158 # Insert product-only params into QModel 2159 if product_params: 2160 prod_rows = FittingUtilities.addSimpleParametersToModel( 2161 parameters=product_params, 2162 is2D=self.is2D, 2163 parameters_original=None, 2164 model=self._model_model, 2165 view=self.lstParams, 2166 row_num=2) 2167 2168 # Since this all happens after shells are dealt with and we've inserted rows, fix this counter 2169 self._n_shells_row += len(prod_rows) 2147 2170 2148 2171 def haveParamsToFit(self): -
src/sas/qtgui/Perspectives/Fitting/UI/OptionsWidgetUI.ui
r79bd268 r309fa1b 32 32 <item row="0" column="1"> 33 33 <widget class="QLineEdit" name="txtMinRange"> 34 <property name="minimumSize"> 35 <size> 36 <width>80</width> 37 <height>0</height> 38 </size> 39 </property> 34 40 <property name="toolTip"> 35 41 <string><html><head/><body><p>Minimum value of Q.</p></body></html></string> … … 54 60 <item row="1" column="1"> 55 61 <widget class="QLineEdit" name="txtMaxRange"> 62 <property name="minimumSize"> 63 <size> 64 <width>80</width> 65 <height>0</height> 66 </size> 67 </property> 56 68 <property name="toolTip"> 57 69 <string><html><head/><body><p>Maximum value of Q.</p></body></html></string> -
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingLogicTest.py
re752ab8 rbfb5d9e 99 99 data.name = "boop" 100 100 data.id = "poop" 101 return_data = (data.x,data.y, 7, None, None, 102 0, True, 0.0, 1, data, 103 data, False, None, 104 None, None, None, 105 None, None) 101 # Condensed return data (new1DPlot only uses these fields) 102 return_data = dict(x = data.x, 103 y = data.y, 104 model = data, 105 data = data) 106 # return_data = (data.x,data.y, 7, None, None, 107 # 0, True, 0.0, 1, data, 108 # data, False, None, 109 # None, None, None, 110 # None, None) 106 111 107 112 new_plot = self.logic.new1DPlot(return_data=return_data, tab_id=0) … … 139 144 qmin, qmax, npts = self.logic.computeDataRange() 140 145 141 return_data = (x_0, data, 7, data, None, 142 True, 0.0, 1, 0, qmin, qmax, 143 0.1, False, None) 146 # Condensed return data (new2DPlot only uses these fields) 147 return_data = dict(image = x_0, 148 data = data, 149 page_id = 7, 150 model = data) 151 # return_data = (x_0, data, 7, data, None, 152 # True, 0.0, 1, 0, qmin, qmax, 153 # 0.1, False, None) 144 154 145 155 new_plot = self.logic.new2DPlot(return_data=return_data) -
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingOptionsTest.py
r725d9c06 rbfb5d9e 38 38 # The combo box 39 39 self.assertIsInstance(self.widget.cbAlgorithm, QtWidgets.QComboBox) 40 self.assertEqual(self.widget.cbAlgorithm.count(), 5)40 self.assertEqual(self.widget.cbAlgorithm.count(), 6) 41 41 self.assertEqual(self.widget.cbAlgorithm.itemText(0), 'Nelder-Mead Simplex') 42 42 self.assertEqual(self.widget.cbAlgorithm.itemText(4), 'Levenberg-Marquardt')
Note: See TracChangeset
for help on using the changeset viewer.