Changeset effdd98 in sasview for src/sas/qtgui/Utilities/GridPanel.py
- Timestamp:
- Apr 10, 2018 1:53:59 PM (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:
- 76567bb
- Parents:
- bb6b037
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Utilities/GridPanel.py
r8b480d27 reffdd98 280 280 index += 1 281 281 282 283 class BatchInversionOutputPanel(BatchOutputPanel): 284 """ 285 Class for stateless grid-like printout of P(r) parameters for any number 286 of data sets 287 """ 288 def __init__(self, parent = None, output_data=None): 289 290 super(BatchInversionOutputPanel, self).__init__(parent, output_data) 291 292 def setupTable(self, data): 293 """ 294 Create tablewidget items and show them, based on params 295 """ 296 # headers 297 param_list = ['Filename', 'Rg', 'Chi^2/dof', 'I(Q=0)', 'Oscillations', 298 'Background', 'P+ Fraction', 'P+1-theta Fraction', 299 'Calculation Time'] 300 # P(r) keys 301 pr_keys = ['background', ] 302 303 keys = data.keys() 304 rows = len(keys) 305 columns = len(param_list) 306 self.tblParams.setColumnCount(columns) 307 self.tblParams.setRowCount(rows) 308 309 for i, param in enumerate(param_list): 310 self.tblParams.setHorizontalHeaderItem(i, QtWidgets.QTableWidgetItem(param)) 311 312 # first - Chi2 and data filename 313 for i_row, (filename, pr) in enumerate(data.items()): 314 out = pr.out 315 cov = pr.cov 316 self.tblParams.setItem(i_row, 0, QtWidgets.QTableWidgetItem( 317 GuiUtils.formatNumber(filename, high=True))) 318 self.tblParams.setItem(i_row, 2, QtWidgets.QTableWidgetItem( 319 "{:.3g}".format(pr.chi2[0]))) 320 self.tblParams.setItem(i_row, 5, QtWidgets.QTableWidgetItem( 321 "{:.3g}".format(pr.background))) 322 self.tblParams.setItem(i_row, 8, QtWidgets.QTableWidgetItem( 323 "{:.2g}".format(pr.elapsed))) 324 if out is not None: 325 self.tblParams.setItem(i_row, 1, QtWidgets.QTableWidgetItem( 326 "{:.3g}".format(pr.rg(out)))) 327 self.tblParams.setItem(i_row, 3, QtWidgets.QTableWidgetItem( 328 "{:.3g}".format(pr.iq0(out)))) 329 self.tblParams.setItem(i_row, 4, QtWidgets.QTableWidgetItem( 330 "{:.3g}".format(pr.oscillations(out)))) 331 self.tblParams.setItem(i_row, 6, QtWidgets.QTableWidgetItem( 332 "{:.3g}".format(pr.get_positive(out)))) 333 self.tblParams.setItem(i_row, 7, QtWidgets.QTableWidgetItem( 334 "{:.3g}".format(pr.get_pos_err(out, cov)))) 335 else: 336 self.tblParams.setItem(i_row, 1, QtWidgets.QTableWidgetItem( 337 "NaN")) 338 self.tblParams.setItem(i_row, 3, QtWidgets.QTableWidgetItem( 339 "NaN")) 340 self.tblParams.setItem(i_row, 4, QtWidgets.QTableWidgetItem( 341 "NaN")) 342 self.tblParams.setItem(i_row, 6, QtWidgets.QTableWidgetItem( 343 "NaN")) 344 self.tblParams.setItem(i_row, 7, QtWidgets.QTableWidgetItem( 345 "NaN")) 346 347 self.tblParams.resizeColumnsToContents()
Note: See TracChangeset
for help on using the changeset viewer.