Changeset 48e55c9 in sasview for src/sas/qtgui/Perspectives
- Timestamp:
- Sep 9, 2018 5:27:05 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- 28965e9
- Parents:
- 4d959c8 (diff), bb477f5 (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. - Location:
- src/sas/qtgui/Perspectives
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingLogic.py
r9ba91b7 r61f0c75 213 213 plots = [] 214 214 for name, result in return_data['intermediate_results'].items(): 215 if not isinstance(result, np.ndarray): 216 continue 215 217 plots.append(self._create1DPlot(tab_id, return_data['x'], result, 216 218 return_data['model'], return_data['data'], -
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r5e0891b rbb477f5 569 569 menu.exec_(self.lstParams.viewport().mapToGlobal(position)) 570 570 except AttributeError as ex: 571 logg ing.error("Error generating context menu: %s" % ex)571 logger.error("Error generating context menu: %s" % ex) 572 572 return 573 573 … … 1456 1456 self.communicate.statusBarUpdateSignal.emit(msg) 1457 1457 msg += results.mesg 1458 logg ing.error(msg)1458 logger.error(msg) 1459 1459 return 1460 1460 … … 1499 1499 if self.calc_fit._interrupting: 1500 1500 msg = "Fitting cancelled by user after: %s s." % GuiUtils.formatNumber(elapsed) 1501 logg ing.warning("\n"+msg+"\n")1501 logger.warning("\n"+msg+"\n") 1502 1502 else: 1503 1503 msg = "Fitting completed successfully in: %s s." % GuiUtils.formatNumber(elapsed) … … 1841 1841 data_to_show = self.data if self.data_is_loaded else self.model_data 1842 1842 if data_to_show is not None: 1843 self.communicate.plotRequestedSignal.emit([data_to_show] )1843 self.communicate.plotRequestedSignal.emit([data_to_show], self.tab_id) 1844 1844 1845 1845 def onOptionsUpdate(self): … … 2052 2052 kernel_module = generate.load_kernel_module(name) 2053 2053 except ModuleNotFoundError as ex: 2054 logg ing.error("Can't find the model "+ str(ex))2054 logger.error("Can't find the model "+ str(ex)) 2055 2055 return 2056 2056 … … 2287 2287 fitted_data.symbol = "Line" 2288 2288 self.createTheoryIndex(fitted_data) 2289 # Switch to the theory tab for user's glee 2290 self.communicate.changeDataExplorerTabSignal.emit(1) 2289 2291 2290 2292 def updateModelIndex(self, fitted_data): … … 2422 2424 2423 2425 if self.data_is_loaded: 2426 # delete any plots associated with the data that were not updated (e.g. to remove beta(Q), S_eff(Q)) 2424 2427 GuiUtils.deleteRedundantPlots(self.all_data[self.data_index], new_plots) 2428 pass 2425 2429 else: 2426 2430 # delete theory items for the model, in order to get rid of any redundant items, e.g. beta(Q), S_eff(Q) … … 2511 2515 """ 2512 2516 # TODO: remimplement thread cancellation 2513 logg ing.error("".join(traceback.format_exception(etype, value, tb)))2517 logger.error("".join(traceback.format_exception(etype, value, tb))) 2514 2518 2515 2519 def setTableProperties(self, table): … … 2693 2697 2694 2698 if not datafile: 2695 logg ing.info("No weight data chosen.")2699 logger.info("No weight data chosen.") 2696 2700 raise IOError 2697 2701 … … 2809 2813 self._n_shells_row = shell_row - 1 2810 2814 2811 # Set the index to the state-kept value 2812 func.setCurrentIndex(self.current_shell_displayed 2813 if self.current_shell_displayed < func.count() else 0) 2815 # Get the default number of shells for the model 2816 kernel_pars = self.kernel_module._model_info.parameters.kernel_parameters 2817 shell_par = None 2818 for par in kernel_pars: 2819 if par.name == param_name: 2820 shell_par = par 2821 break 2822 if not shell_par: 2823 logger.error("Could not find %s in kernel parameters.", param_name) 2824 default_shell_count = shell_par.default 2825 2826 # Add default number of shells to the model 2827 func.setCurrentIndex(default_shell_count) 2814 2828 2815 2829 def modifyShellsInList(self, index): … … 3125 3139 param_value = str(self._model_model.item(row, 1).text()) 3126 3140 param_error = None 3141 param_min = None 3142 param_max = None 3127 3143 column_offset = 0 3128 3144 if self.has_error_column: 3129 3145 param_error = str(self._model_model.item(row, 2).text()) 3130 3146 column_offset = 1 3131 param_min = str(self._model_model.item(row, 2+column_offset).text()) 3132 param_max = str(self._model_model.item(row, 3+column_offset).text()) 3147 3148 try: 3149 param_min = str(self._model_model.item(row, 2+column_offset).text()) 3150 param_max = str(self._model_model.item(row, 3+column_offset).text()) 3151 except: 3152 pass 3153 3133 3154 param_list.append([param_name, param_checked, param_value, param_error, param_min, param_max]) 3134 3155 … … 3220 3241 3221 3242 # limits 3222 limit_lo = item[3] 3223 context[name].append(limit_lo) 3224 limit_hi = item[4] 3225 context[name].append(limit_hi) 3243 try: 3244 limit_lo = item[3] 3245 context[name].append(limit_lo) 3246 limit_hi = item[4] 3247 context[name].append(limit_hi) 3248 except: 3249 pass 3226 3250 3227 3251 # Polydisp … … 3282 3306 ioffset = 1 3283 3307 # min/max 3284 param_repr = GuiUtils.formatNumber(param_dict[param_name][2+ioffset], high=True) 3285 self._model_model.item(row, 2+ioffset).setText(param_repr) 3286 param_repr = GuiUtils.formatNumber(param_dict[param_name][3+ioffset], high=True) 3287 self._model_model.item(row, 3+ioffset).setText(param_repr) 3308 try: 3309 param_repr = GuiUtils.formatNumber(param_dict[param_name][2+ioffset], high=True) 3310 self._model_model.item(row, 2+ioffset).setText(param_repr) 3311 param_repr = GuiUtils.formatNumber(param_dict[param_name][3+ioffset], high=True) 3312 self._model_model.item(row, 3+ioffset).setText(param_repr) 3313 except: 3314 pass 3315 3288 3316 self.setFocus() 3317 3289 3318 3290 3319 -
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingWidgetTest.py
r4ea8020 rf712bf30 613 613 614 614 # Check that the number of rows increased 615 # (note that n == 1 by default in core_multi_shell so this increases index by 2) 615 616 more_rows = self.widget._model_model.rowCount() - last_row 616 self.assertEqual(more_rows, 6) # 6new rows: 2 params per index617 618 # Backto 0617 self.assertEqual(more_rows, 4) # 4 new rows: 2 params per index 618 619 # Set to 0 619 620 self.widget.lstParams.indexWidget(func_index).setCurrentIndex(0) 620 self.assertEqual(self.widget._model_model.rowCount(), last_row )621 self.assertEqual(self.widget._model_model.rowCount(), last_row - 2) # 2 fewer rows than default 621 622 622 623 def testPlotTheory(self): -
src/sas/qtgui/Perspectives/Inversion/InversionPerspective.py
r4d959c8 r48e55c9 562 562 title = self.prPlot.name 563 563 GuiUtils.updateModelItemWithPlot(self._data, self.prPlot, title) 564 self.communicate.plotRequestedSignal.emit([self.prPlot] )564 self.communicate.plotRequestedSignal.emit([self.prPlot], None) 565 565 if self.dataPlot is not None: 566 566 title = self.dataPlot.name 567 567 GuiUtils.updateModelItemWithPlot(self._data, self.dataPlot, title) 568 self.communicate.plotRequestedSignal.emit([self.dataPlot] )568 self.communicate.plotRequestedSignal.emit([self.dataPlot], None) 569 569 self.enableButtons() 570 570 -
src/sas/qtgui/Perspectives/Inversion/DMaxExplorerWidget.py
rb0ba43e re908916 42 42 self.parent = parent 43 43 44 self.setWindowTitle("D ââExplorer")44 self.setWindowTitle("Dmax Explorer") 45 45 46 46 self.pr_state = pr_state … … 116 116 bck = [] 117 117 chi2 = [] 118 118 plotable_xs = [] #Introducing this to make sure size of x and y for plotting is the same.8 119 119 try: 120 120 dmin = float(self.model.item(W.DMIN).text()) … … 128 128 129 129 original = self.pr_state.d_max 130 130 131 for x in xs: 131 132 self.pr_state.d_max = x … … 140 141 bck.append(self.pr_state.background) 141 142 chi2.append(self.pr_state.chi2) 143 plotable_xs.append(x) 142 144 except Exception as ex: 143 145 # This inversion failed, skip this D_max value … … 188 190 y_unit = "a.u." 189 191 190 data = Data1D( xs, ys)192 data = Data1D(plotable_xs, ys) 191 193 if self.hasPlot: 192 194 self.plot.removePlot(None)
Note: See TracChangeset
for help on using the changeset viewer.