Changeset 76567bb in sasview
- Timestamp:
- Apr 13, 2018 4:00:37 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:
- b9e89d5
- Parents:
- effdd98
- Location:
- src/sas/qtgui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Inversion/InversionPerspective.py
reffdd98 r76567bb 34 34 35 35 36 # TODO: Use communicator to catch data deletions 36 37 # TODO: Update help with batch capabilities 37 # TODO: Method to export results in some meaningful way38 38 class InversionWindow(QtWidgets.QDialog, Ui_PrInversion): 39 39 """ … … 381 381 382 382 def showBatchOutput(self, output_data): 383 """ 384 Display the batch output in tabular form 385 :param output_data: Dictionary mapping filename -> P(r) instance 386 """ 383 387 if self.grid_window is None: 384 388 self.grid_window = BatchInversionOutputPanel( 385 389 parent=self, output_data=output_data) 390 else: 391 self.grid_window.setupTable(output_data) 386 392 self.grid_window.show() 387 393 … … 499 505 self.dmaxWindow.close() 500 506 self.dmaxWindow = None 501 current_data = self._data 507 self._data_list.pop(self._data) 508 self._data = None 502 509 self.dataList.removeItem(self.dataList.currentIndex()) 503 self._data_list.pop(current_data)504 510 # Last file removed 505 511 if len(self._data_list) == 0: … … 527 533 for data_ref in self._data_list.keys(): 528 534 self.setCurrentData(data_ref) 535 self.performEstimate() 536 self.performEstimateNT() 537 self.acceptAlpha() 538 self.acceptNoTerms() 529 539 self.startThread() 530 540 output[self.logic.data.filename] = self._calculator … … 581 591 self.estimation_thread_nt.queue() 582 592 self.estimation_thread_nt.ready(2.5) 593 if self.waitForEach: 594 if self.estimation_thread_nt.isrunning(): 595 self.estimation_thread_nt.update() 583 596 584 597 def performEstimate(self): … … 599 612 self.estimation_thread.queue() 600 613 self.estimation_thread.ready(2.5) 614 if self.waitForEach: 615 if self.estimation_thread.isrunning(): 616 self.estimation_thread.update() 601 617 602 618 ###################################################################### … … 618 634 if message: 619 635 logging.info(message) 620 self.performEstimateNT() 636 if not self.waitForEach: 637 self.performEstimateNT() 621 638 622 639 def _estimateNTCompleted(self, nterms, alpha, message, elapsed): -
src/sas/qtgui/Utilities/GridPanel.py
reffdd98 r76567bb 295 295 """ 296 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',]297 param_list = ['Filename', 'Rg [Ã 298 ]', 'Ï^2/dof', 'I(Q=0)', 'Oscillations', 299 'Background [Ã 300 ^-1]', 'P+ Fraction', 'P+1-Ï Fraction', 301 'Calc. Time [sec]'] 302 302 303 303 keys = data.keys() … … 314 314 out = pr.out 315 315 cov = pr.cov 316 if out is None: 317 logging.warning("P(r) for {} did not converge.".format(filename)) 318 continue 316 319 self.tblParams.setItem(i_row, 0, QtWidgets.QTableWidgetItem( 317 GuiUtils.formatNumber(filename, high=True)))320 "{}".format(filename))) 318 321 self.tblParams.setItem(i_row, 2, QtWidgets.QTableWidgetItem( 319 322 "{:.3g}".format(pr.chi2[0]))) … … 322 325 self.tblParams.setItem(i_row, 8, QtWidgets.QTableWidgetItem( 323 326 "{:.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")) 327 self.tblParams.setItem(i_row, 1, QtWidgets.QTableWidgetItem( 328 "{:.3g}".format(pr.rg(out)))) 329 self.tblParams.setItem(i_row, 3, QtWidgets.QTableWidgetItem( 330 "{:.3g}".format(pr.iq0(out)))) 331 self.tblParams.setItem(i_row, 4, QtWidgets.QTableWidgetItem( 332 "{:.3g}".format(pr.oscillations(out)))) 333 self.tblParams.setItem(i_row, 6, QtWidgets.QTableWidgetItem( 334 "{:.3g}".format(pr.get_positive(out)))) 335 self.tblParams.setItem(i_row, 7, QtWidgets.QTableWidgetItem( 336 "{:.3g}".format(pr.get_pos_err(out, cov)))) 346 337 347 338 self.tblParams.resizeColumnsToContents() 339 340 @classmethod 341 def onHelp(cls): 342 """ 343 Open a local url in the default browser 344 """ 345 # TODO: Add anchor to batch fitting help when written 346 location = GuiUtils.HELP_DIRECTORY_LOCATION 347 url = "/user/sasgui/perspectives/pr/pr_help.html" 348 try: 349 webbrowser.open('file://' + os.path.realpath(location + url)) 350 except webbrowser.Error as ex: 351 logging.warning("Cannot display help. %s" % ex)
Note: See TracChangeset
for help on using the changeset viewer.