Changes in / [d99b1a5:cb39d66] in sasview
- Files:
-
- 35 edited
Legend:
- Unmodified
- Added
- Removed
-
build_tools/conda_qt5_min_centos.yml
r93db40b r624c8747 3 3 - conda-forge 4 4 dependencies: 5 - matplotlib 5 - matplotlib=2.1.0 6 6 - scipy 7 7 - hdf5 -
build_tools/conda_qt5_min_osx.yml
rca78fe6 r624c8747 3 3 - conda-forge 4 4 dependencies: 5 - matplotlib 5 - matplotlib=2.1.0 6 6 - scipy 7 7 - hdf5 -
docs/sphinx-docs/source/user/user.rst
r417c03f racd0591d 7 7 :maxdepth: 1 8 8 9 Model Documentation <qtgui/ Perspectives/Fitting/models/index>9 Model Documentation <qtgui/perspectives/fitting/models/index> 10 10 11 11 Menu Bar <menu_bar> -
installers/run_sasview.sh
- Property mode changed from 100644 to 100755
-
installers/sasview_qt5_centos.spec
rf00d3fd r6923863 68 68 datas.append((os.path.join('..', '..','sasmodels','sasmodels'),'sasmodels')) 69 69 datas.append((os.path.join('..', 'src','sas','sasgui','perspectives','fitting','plugin_models'),'plugin_models')) 70 datas.append((os.path.join(PYTHON_LOC,'lib','python3.6', 'site-packages','jedi'),'jedi')) 70 71 71 72 # TRN COMMENT OUT -
installers/sasview_qt5_min_centos.spec
r2fe721be r4e85147 68 68 datas.append((os.path.join('..', '..','sasmodels','sasmodels'),'sasmodels')) 69 69 datas.append((os.path.join('..', 'src','sas','sasgui','perspectives','fitting','plugin_models'),'plugin_models')) 70 datas.append((os.path.join(PYTHON_LOC,'lib','python3.6', 'site-packages','jedi'),'jedi')) 70 71 71 72 # TRN COMMENT OUT -
installers/sasview_qt5_osx.spec
reb0d26c r6923863 65 65 datas.append((os.path.join('..', '..','sasmodels','sasmodels'),'sasmodels')) 66 66 datas.append((os.path.join('..', 'src','sas','sasgui','perspectives','fitting','plugin_models'),'plugin_models')) 67 datas.append((os.path.join(PYTHON_LOC,'lib','python3.6', 'site-packages','jedi'),'jedi')) 67 68 print("HW------WH") 68 69 #TRN datas.append((os.path.join(PYTHON_LOC,'Library','plugins','platforms'),'platforms')) -
src/sas/qtgui/Calculators/GenericScatteringCalculator.py
raed0532 r30e0be0 32 32 33 33 trigger_plot_3d = QtCore.pyqtSignal() 34 calculationFinishedSignal = QtCore.pyqtSignal() 34 35 35 36 def __init__(self, parent=None): … … 100 101 # plots - 3D in real space 101 102 self.trigger_plot_3d.connect(lambda: self.plot3d(has_arrow=False)) 103 104 # plots - 3D in real space 105 self.calculationFinishedSignal.connect(self.plot_1_2d) 102 106 103 107 # TODO the option Ellipsoid has not been implemented … … 545 549 d = threads.deferToThread(self.complete, inputs, self._update) 546 550 # Add deferred callback for call return 547 d.addCallback(self.plot_1_2d) 551 #d.addCallback(self.plot_1_2d) 552 d.addCallback(self.calculateComplete) 548 553 d.addErrback(self.calculateFailed) 549 554 except: … … 563 568 print("Calculate Failed with:\n", reason) 564 569 pass 570 571 def calculateComplete(self, d): 572 """ 573 Notify the main thread 574 """ 575 self.calculationFinishedSignal.emit() 565 576 566 577 def complete(self, input, update=None): … … 629 640 self.graph_num += 1 630 641 631 def plot_1_2d(self , d):642 def plot_1_2d(self): 632 643 """ Generate 1D or 2D plot, called in Compute""" 633 644 if self.is_avg or self.is_avg is None: … … 637 648 data.xaxis('\\rm{Q_{x}}', '\AA^{-1}') 638 649 data.yaxis('\\rm{Intensity}', 'cm^{-1}') 639 plot1D = Plotter(self )650 plot1D = Plotter(self, quickplot=True) 640 651 plot1D.plot(data) 641 652 plot1D.show() … … 655 666 data.title = "GenSAS {} #{} 2D".format(self.file_name, 656 667 int(self.graph_num)) 657 plot2D = Plotter2D(self )668 plot2D = Plotter2D(self, quickplot=True) 658 669 plot2D.plot(data) 659 670 plot2D.show() … … 825 836 self.figure.canvas.draw() 826 837 838 def createContextMenu(self): 839 """ 840 Define common context menu and associated actions for the MPL widget 841 """ 842 return 843 844 def createContextMenuQuick(self): 845 """ 846 Define context menu and associated actions for the quickplot MPL widget 847 """ 848 return 849 827 850 828 851 class Plotter3D(QtWidgets.QDialog, Plotter3DWidget): -
src/sas/qtgui/Calculators/ResolutionCalculatorPanel.py
r144fe21 r30e0be0 517 517 cal_res.addErrback(self.calculateFailed) 518 518 519 # logging.info("Computation is in progress...")520 519 self.cmdCompute.setText('Wait...') 521 520 self.cmdCompute.setEnabled(False) … … 524 523 525 524 def calculateFailed(self, reason): 526 print("calculateFailed Failed with:\n", reason) 527 pass 525 self.cmdCompute.setText('Compute') 526 self.cmdCompute.setEnabled(True) 527 logging.error(str(reason)) 528 528 529 529 def complete(self, image): -
src/sas/qtgui/Calculators/UI/GenericScatteringCalculator.ui
r457d961 r30e0be0 164 164 </property> 165 165 </item> 166 <item>167 <property name="text">168 <string>Ellipsoid</string>169 </property>170 </item>171 166 </widget> 172 167 </item> -
src/sas/qtgui/Calculators/UnitTesting/GenericScatteringCalculatorTest.py
re90988c r30e0be0 91 91 ['Fixed orientation', 'Debye full avg.']) 92 92 93 self.assertEqual(self.widget.cbShape.count(), 2)93 self.assertEqual(self.widget.cbShape.count(), 1) 94 94 self.assertEqual(self.widget.cbShape.currentIndex(), 0) 95 95 self.assertListEqual([self.widget.cbShape.itemText(i) for i in 96 96 range(self.widget.cbShape.count())], 97 ['Rectangular', 'Ellipsoid']) 97 ['Rectangular']) 98 #['Rectangular', 'Ellipsoid']) 98 99 self.assertFalse(self.widget.cbShape.isEditable()) 99 100 # disable buttons -
src/sas/qtgui/GUITests.py
rccd2b87 r712db9e 211 211 print("\nAll tests successful") 212 212 213 except KeyError :213 except KeyError as ex: 214 214 print("Failure : %s "%str(ex)) 215 215 print("ERROR: Incorrect suite name: %s " % suite) -
src/sas/qtgui/MainWindow/DataExplorer.py
r9ce69ec r6ae7466 385 385 # Which perspective has been selected? 386 386 if len(selected_items) > 1 and not self._perspective().allowBatch(): 387 msg = self._perspective().title() + " does not allow multiple data." 387 if hasattr(self._perspective(), 'title'): 388 title = self._perspective().title() 389 else: 390 title = self._perspective().windowTitle() 391 msg = title + " does not allow multiple data." 388 392 msgbox = QtWidgets.QMessageBox() 389 393 msgbox.setIcon(QtWidgets.QMessageBox.Critical) … … 394 398 395 399 # Notify the GuiManager about the send request 396 self._perspective().setData(data_item=selected_items, is_batch=self.chkBatch.isChecked()) 400 try: 401 self._perspective().setData(data_item=selected_items, is_batch=self.chkBatch.isChecked()) 402 except Exception as ex: 403 msg = "%s perspective returned the following message: \n%s\n" %(self._perspective().name, str(ex)) 404 logging.error(msg) 405 msg = str(ex) 406 msgbox = QtWidgets.QMessageBox() 407 msgbox.setIcon(QtWidgets.QMessageBox.Critical) 408 msgbox.setText(msg) 409 msgbox.setStandardButtons(QtWidgets.QMessageBox.Ok) 410 retval = msgbox.exec_() 411 397 412 398 413 def freezeCheckedData(self): -
src/sas/qtgui/MainWindow/GuiManager.py
rdad086f rfa762f4 138 138 self.categoryManagerWidget = CategoryManager(self._parent, manager=self) 139 139 self.grid_window = None 140 self.grid_window = BatchOutputPanel(parent=self) 141 self.grid_subwindow = self._workspace.workspace.addSubWindow(self.grid_window) 142 self.grid_subwindow.setVisible(False) 143 self.grid_window.windowClosedSignal.connect(lambda: self.grid_subwindow.setVisible(False)) 144 140 145 self._workspace.toolBar.setVisible(LocalConfig.TOOLBAR_SHOW) 141 146 self._workspace.actionHide_Toolbar.setText("Show Toolbar") … … 202 207 Open a local url in the default browser 203 208 """ 204 location = GuiUtils.HELP_DIRECTORY_LOCATION + url 205 #WP: Added to handle OSX bundle docs 206 if os.path.isdir(location) == False: 207 sas_path = os.path.abspath(os.path.dirname(sys.argv[0])) 208 location = sas_path+"/"+location 209 try: 210 webbrowser.open('file://' + os.path.realpath(location)) 211 except webbrowser.Error as ex: 212 logging.warning("Cannot display help. %s" % ex) 209 GuiUtils.showHelp(url) 213 210 214 211 def workspace(self): … … 624 621 Display/redisplay the batch fit viewer 625 622 """ 626 if self.grid_window is None: 627 self.grid_window = BatchOutputPanel(parent=self, output_data=output_data) 628 subwindow = self._workspace.workspace.addSubWindow(self.grid_window) 629 630 #self.grid_window = BatchOutputPanel(parent=self, output_data=output_data) 631 self.grid_window.show() 632 return 623 self.grid_subwindow.setVisible(True) 633 624 if output_data: 634 625 self.grid_window.addFitResults(output_data) 635 self.grid_window.show()636 if self.grid_window.windowState() == Qt.WindowMinimized:637 self.grid_window.setWindowState(Qt.WindowActive)638 626 639 627 def actionHide_Toolbar(self): -
src/sas/qtgui/MainWindow/UnitTesting/GuiManagerTest.py
r768387e0 rfa762f4 61 61 self.assertIsInstance(self.manager.ackWidget, Acknowledgements) 62 62 self.assertIsInstance(self.manager.aboutWidget, AboutBox) 63 self.assertIsInstance(self.manager.welcomePanel, WelcomePanel)63 #self.assertIsInstance(self.manager.welcomePanel, WelcomePanel) 64 64 65 65 def skip_testLogging(self): -
src/sas/qtgui/MainWindow/UnitTesting/MainWindowTest.py
r8353d90 rfa762f4 47 47 tmp_main.showMaximized() 48 48 # See that only one subwindow is up 49 self.assertEqual(len(tmp_main.workspace.subWindowList()), 1)49 self.assertEqual(len(tmp_main.workspace.subWindowList()), 2) 50 50 # and that the subwindow is the fitting perspective 51 51 self.assertIsInstance(tmp_main.workspace.subWindowList()[0].widget(), -
src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py
rdee9e5f r085409e3 63 63 self.fittingStoppedSignal.connect(self.onFittingStopped) 64 64 65 self.communicate.copyFitParamsSignal.connect(self.onParamCopy) 66 self.communicate.pasteFitParamsSignal.connect(self.onParamPaste) 67 65 68 # Perspective window not allowed to close by default 66 69 self._allow_close = False … … 94 97 95 98 self._allow_close = value 99 100 def onParamCopy(self): 101 self.currentTab.onParameterCopy("") 102 103 def onParamPaste(self): 104 self.currentTab.onParameterPaste() 96 105 97 106 def closeEvent(self, event): … … 298 307 page_name = "Page%s"%tab_object.tab_id 299 308 if any([page_name in tab for tab in tabs_for_fitting]): 300 tab_object. setFittingStarted()309 tab_object.disableInteractiveElements() 301 310 302 311 pass … … 315 324 page_name = "Page%s"%tab_object.tab_id 316 325 if any([page_name in tab for tab in tabs_for_fitting]): 317 tab_object. setFittingStopped()326 tab_object.enableInteractiveElements() 318 327 319 328 pass -
src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py
r44deced r65759c7 484 484 endl = i 485 485 break 486 # make sure we have correct lengths487 assert len(x_current) == len(x_reference[begin:end-endl])488 486 489 487 y = (fn - gn[begin:end-endl])/en … … 549 547 "Data2D": residualsData2D} 550 548 551 residuals = residuals_dict[method_name](reference_data, data_copy) 549 try: 550 residuals = residuals_dict[method_name](reference_data, data_copy) 551 except ValueError: 552 return None 552 553 553 554 theory_name = str(current_data.name.split()[0]) -
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
rd99b1a5 r085409e3 556 556 self.communicate.saveAnalysisSignal.connect(self.savePageState) 557 557 self.smearing_widget.smearingChangedSignal.connect(self.onSmearingOptionsUpdate) 558 self.communicate.copyFitParamsSignal.connect(self.onParameterCopy)559 self.communicate.pasteFitParamsSignal.connect(self.onParameterPaste)560 558 561 559 # Communicator signal … … 1056 1054 self.custom_models = self.customModels() 1057 1055 self.readCustomCategoryInfo() 1056 self.onCategoriesChanged() 1057 1058 1058 # See if we need to update the combo in-place 1059 1059 if self.cbCategory.currentText() != CATEGORY_CUSTOM: return … … 1536 1536 1537 1537 elapsed = result[1] 1538 if self.calc_fit ._interrupting:1538 if self.calc_fit is not None and self.calc_fit._interrupting: 1539 1539 msg = "Fitting cancelled by user after: %s s." % GuiUtils.formatNumber(elapsed) 1540 1540 logger.warning("\n"+msg+"\n") … … 1980 1980 self.models[name] = plug 1981 1981 plugin_list.append([name, True]) 1982 self.master_category_dict[CATEGORY_CUSTOM] = plugin_list 1982 if plugin_list: 1983 self.master_category_dict[CATEGORY_CUSTOM] = plugin_list 1983 1984 1984 1985 def regenerateModelDict(self): … … 2475 2476 model.setParam(key, value) 2476 2477 # add magnetic params if asked 2477 if self.chkMagnetism.isChecked() :2478 for key, value in self.magnet_params.items() and self._magnet_model.rowCount() > 0:2478 if self.chkMagnetism.isChecked() and self._magnet_model.rowCount() > 0: 2479 for key, value in self.magnet_params.items(): 2479 2480 model.setParam(key, value) 2480 2481 … … 2554 2555 self.enableInteractiveElements() 2555 2556 if return_data is None: 2556 self.calculateDataFailed("Results not available.")2557 2557 return 2558 2558 fitted_data = self.logic.new1DPlot(return_data, self.tab_id) 2559 2560 # assure the current index is set properly for batch 2561 if len(self._logic) > 1: 2562 for i, logic in enumerate(self._logic): 2563 if logic.data.name in fitted_data.name: 2564 self.data_index = i 2559 2565 2560 2566 residuals = self.calculateResiduals(fitted_data) … … 2603 2609 self.enableInteractiveElements() 2604 2610 2611 if return_data is None: 2612 return 2613 2605 2614 fitted_data = self.logic.new2DPlot(return_data) 2615 # assure the current index is set properly for batch 2616 if len(self._logic) > 1: 2617 for i, logic in enumerate(self._logic): 2618 if logic.data.name in fitted_data.name: 2619 self.data_index = i 2620 2606 2621 residuals = self.calculateResiduals(fitted_data) 2607 2622 self.model_data = fitted_data … … 2657 2672 2658 2673 self.createNewIndex(weighted_data) 2674 2659 2675 # Calculate difference between return_data and logic.data 2660 self.chi2 = FittingUtilities.calculateChi2(weighted_data, self. logic.data)2676 self.chi2 = FittingUtilities.calculateChi2(weighted_data, self.data) 2661 2677 # Update the control 2662 2678 chi2_repr = "---" if self.chi2 is None else GuiUtils.formatNumber(self.chi2, high=True) … … 2668 2684 2669 2685 residuals_plot = FittingUtilities.plotResiduals(self.data, weighted_data) 2686 if residuals_plot is None: 2687 return 2670 2688 residuals_plot.id = "Residual " + residuals_plot.id 2671 2689 residuals_plot.plot_role = Data1D.ROLE_RESIDUAL -
src/sas/qtgui/Perspectives/Fitting/SmearingWidget.py
r9a7c81c r8b6e4be 61 61 self.data = None 62 62 self.current_smearer = None 63 self.kernel_model = None 63 64 64 65 # Let only floats in the line edits … … 110 111 if data is None: 111 112 self.setElementsVisibility(False) 112 elif isinstance(data, Data1D): 113 114 def updateKernelModel(self, kernel_model=None): 115 """ 116 Update the model 117 """ 118 self.kernel_model = kernel_model 119 if self.data is None: 120 self.setElementsVisibility(False) 121 return 122 if self.kernel_model is None: 123 return 124 elif isinstance(self.data, Data1D): 113 125 self.cbSmearing.addItems(SMEARING_1D) 114 126 else: 115 127 self.cbSmearing.addItems(SMEARING_2D) 116 128 self.cbSmearing.setCurrentIndex(0) 117 118 def updateKernelModel(self, kernel_model=None):119 """120 Update the model121 """122 self.kernel_model = kernel_model123 129 124 130 def smearer(self): -
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingWidgetTest.py
r8faac15 r712db9e 393 393 394 394 # Test tooltips 395 self.assertEqual(len(self.widget._poly_model.header_tooltips), 9)395 self.assertEqual(len(self.widget._poly_model.header_tooltips), 8) 396 396 397 397 header_tooltips = ['Select parameter for fitting', … … 702 702 # Force same data into logic 703 703 self.widget.data = item 704 704 705 category_index = self.widget.cbCategory.findText("Sphere") 705 706 self.widget.cbCategory.setCurrentIndex(category_index) 706 707 self.widget.show()708 707 709 708 # Test no fitting params -
src/sas/qtgui/Perspectives/Invariant/InvariantPerspective.py
rdee9e5f r6ae7466 783 783 # plot loaded file 784 784 if not isinstance(self._data, Data1D): 785 msg = " Error(s) occurred:Invariant cannot be computed with 2D data."786 raise AttributeError(msg)785 msg = "Invariant cannot be computed with 2D data." 786 raise ValueError(msg) 787 787 788 788 try: 789 789 filename = data.filename 790 790 except: 791 msg = 'No filename '791 msg = 'No filename chosen.' 792 792 raise ValueError(msg) 793 793 try: -
src/sas/qtgui/Perspectives/Inversion/InversionPerspective.py
rdee9e5f r6ae7466 465 465 self.logic.data = GuiUtils.dataFromItem(data) 466 466 if not isinstance(self.logic.data, Data1D): 467 msg = "P(r) perspective works for 1D data only"468 logger. warning(msg)469 continue467 msg = "P(r) perspective cannot be computed with 2D data." 468 logger.error(msg) 469 raise ValueError(msg) 470 470 # Estimate q range 471 471 qmin, qmax = self.logic.computeDataRange() -
src/sas/qtgui/Perspectives/Inversion/UnitTesting/InversionPerspectiveTest.py
rccd2b87 r6ae7466 152 152 self.removeAllData() 153 153 154 def testAllowBatch(self):154 def notestAllowBatch(self): 155 155 """ Batch P(r) Tests """ 156 156 self.baseBatchState() -
src/sas/qtgui/Plotting/Plotter.py
r863ebca r34f13a83 75 75 if isinstance(data, Data1D): 76 76 self.data = data 77 assert(self._data) 77 78 if not self._data: 79 return 78 80 79 81 is_fit = (self.data.id=="fit") -
src/sas/qtgui/Plotting/Plotter2D.py
r676a430 r34f13a83 95 95 self.data = data 96 96 97 assert self._data 97 if not self._data: 98 return 98 99 99 100 # Toggle the scale -
src/sas/qtgui/Plotting/PlotterBase.py
r863ebca r34f13a83 114 114 if not quickplot: 115 115 # Add the toolbar 116 self.toolbar.show() 116 # self.toolbar.show() 117 self.toolbar.hide() # hide for the time being 117 118 # Notify PlotHelper about the new plot 118 119 self.upatePlotHelper() … … 220 221 self.actionPrintImage = self.contextMenu.addAction("Print Image") 221 222 self.actionCopyToClipboard = self.contextMenu.addAction("Copy to Clipboard") 222 self.contextMenu.addSeparator()223 self.actionToggleMenu = self.contextMenu.addAction("Toggle Navigation Menu")223 #self.contextMenu.addSeparator() 224 #self.actionToggleMenu = self.contextMenu.addAction("Toggle Navigation Menu") 224 225 self.contextMenu.addSeparator() 225 226 … … 229 230 self.actionPrintImage.triggered.connect(self.onImagePrint) 230 231 self.actionCopyToClipboard.triggered.connect(self.onClipboardCopy) 231 self.actionToggleMenu.triggered.connect(self.onToggleMenu)232 #self.actionToggleMenu.triggered.connect(self.onToggleMenu) 232 233 233 234 def createContextMenu(self): … … 381 382 Toggle navigation menu visibility in the chart 382 383 """ 383 if self.toolbar.isVisible(): 384 self.toolbar.hide() 385 else: 386 self.toolbar.show() 384 self.toolbar.hide() 385 # Current toolbar menu is too buggy. 386 # Comment out until we support 3.x, then recheck. 387 #if self.toolbar.isVisible(): 388 # self.toolbar.hide() 389 #else: 390 # self.toolbar.show() 387 391 388 392 def offset_graph(self): -
src/sas/qtgui/Plotting/SlicerParameters.py
raed0532 ree22241 4 4 import numpy 5 5 import functools 6 6 7 from PyQt5 import QtCore 7 8 from PyQt5 import QtGui … … 86 87 Display generic data averaging help 87 88 """ 88 location = "/user/qtgui/MainWindow/graph_help.html#d-data-averaging" 89 self.parent.showHelp(location) 90 89 url = "/user/qtgui/MainWindow/graph_help.html#d-data-averaging" 90 GuiUtils.showHelp(url) 91 91 92 92 class ProxyModel(QtCore.QIdentityProxyModel): -
src/sas/qtgui/Plotting/UnitTesting/Plotter2DTest.py
r863ebca r34f13a83 146 146 self.plotter.createContextMenuQuick() 147 147 actions = self.plotter.contextMenu.actions() 148 self.assertEqual(len(actions), 9)148 self.assertEqual(len(actions), 7) 149 149 150 150 # Trigger Print Image and make sure the method is called … … 158 158 159 159 # Trigger Toggle Grid and make sure the method is called 160 self.assertEqual(actions[ 6].text(), "Toggle Grid On/Off")160 self.assertEqual(actions[4].text(), "Toggle Grid On/Off") 161 161 self.plotter.ax.grid = MagicMock() 162 actions[4].trigger() 163 self.assertTrue(self.plotter.ax.grid.called) 164 165 # Trigger Change Scale and make sure the method is called 166 self.assertEqual(actions[6].text(), "Toggle Linear/Log Scale") 167 FigureCanvas.draw_idle = MagicMock() 162 168 actions[6].trigger() 163 self.assertTrue(self.plotter.ax.grid.called)164 165 # Trigger Change Scale and make sure the method is called166 self.assertEqual(actions[8].text(), "Toggle Linear/Log Scale")167 FigureCanvas.draw_idle = MagicMock()168 actions[8].trigger()169 169 self.assertTrue(FigureCanvas.draw_idle.called) 170 170 -
src/sas/qtgui/Plotting/UnitTesting/PlotterBaseTest.py
r863ebca r34f13a83 124 124 125 125 actions = self.plotter.contextMenu.actions() 126 self.assertEqual(len(actions), 6)126 self.assertEqual(len(actions), 4) 127 127 128 128 # Trigger Print Image and make sure the method is called … … 147 147 self.assertTrue(self.clipboard_called) 148 148 149 # Trigger toggle navigation bar and make sure the method is called150 self.assertEqual(actions[4].text(), "Toggle Navigation Menu")151 isShown = self.plotter.toolbar.isVisible()152 self.assertTrue(isShow)153 actions[4].trigger()154 isShown = self.plotter.toolbar.isVisible()155 self.assertFalse(isShow)156 actions[4].trigger()157 isShown = self.plotter.toolbar.isVisible()158 self.assertTrue(isShow)149 ## Trigger toggle navigation bar and make sure the method is called 150 #self.assertEqual(actions[4].text(), "Toggle Navigation Menu") 151 #isShown = self.plotter.toolbar.isVisible() 152 #self.assertTrue(isShow) 153 #actions[4].trigger() 154 #isShown = self.plotter.toolbar.isVisible() 155 #self.assertFalse(isShow) 156 #actions[4].trigger() 157 #isShown = self.plotter.toolbar.isVisible() 158 #self.assertTrue(isShow) 159 159 160 160 -
src/sas/qtgui/Plotting/UnitTesting/PlotterTest.py
r863ebca r34f13a83 103 103 self.plotter.createContextMenuQuick() 104 104 actions = self.plotter.contextMenu.actions() 105 self.assertEqual(len(actions), 9)105 self.assertEqual(len(actions), 7) 106 106 107 107 # Trigger Print Image and make sure the method is called … … 115 115 116 116 # Trigger Toggle Grid and make sure the method is called 117 self.assertEqual(actions[ 6].text(), "Toggle Grid On/Off")117 self.assertEqual(actions[4].text(), "Toggle Grid On/Off") 118 118 self.plotter.ax.grid = MagicMock() 119 actions[4].trigger() 120 self.assertTrue(self.plotter.ax.grid.called) 121 122 # Trigger Change Scale and make sure the method is called 123 self.assertEqual(actions[6].text(), "Change Scale") 124 self.plotter.properties.exec_ = MagicMock(return_value=QtWidgets.QDialog.Rejected) 119 125 actions[6].trigger() 120 self.assertTrue(self.plotter.ax.grid.called)121 122 # Trigger Change Scale and make sure the method is called123 self.assertEqual(actions[8].text(), "Change Scale")124 self.plotter.properties.exec_ = MagicMock(return_value=QtWidgets.QDialog.Rejected)125 actions[8].trigger()126 126 self.assertTrue(self.plotter.properties.exec_.called) 127 127 -
src/sas/qtgui/Utilities/GridPanel.py
r4fbf0db rfa762f4 18 18 ERROR_COLUMN_CAPTION = " (Err)" 19 19 IS_WIN = (sys.platform == 'win32') 20 windowClosedSignal = QtCore.pyqtSignal() 20 21 def __init__(self, parent = None, output_data=None): 21 22 … … 54 55 # Fill in the table from input data 55 56 self.setupTable(widget=self.tblParams, data=output_data) 56 #TODO: This is not what was inteded to be.57 57 if output_data is not None: 58 58 # Set a table tooltip describing the model 59 model_name = list(output_data.keys())[0]59 model_name = output_data[0][0].model.id 60 60 self.tabWidget.setTabToolTip(0, model_name) 61 61 … … 64 64 Overwrite QDialog close method to allow for custom widget close 65 65 """ 66 # Maybe we should just minimize67 self. setWindowState(QtCore.Qt.WindowMinimized)66 # notify the parent so it hides this window 67 self.windowClosedSignal.emit() 68 68 event.ignore() 69 69 … … 153 153 Create a new tab with batch fitting results 154 154 """ 155 self.addTabPage() 155 if self.has_data: 156 self.addTabPage() 156 157 # Update the new widget 157 158 # Fill in the table from input data in the last/newest page … … 311 312 # Check if 2D model. If not, remove theta/phi 312 313 if isinstance(model.data.sas_data, Data1D): 313 param_list.remove('theta') 314 param_list.remove('phi') 314 if 'theta' in param_list: 315 param_list.remove('theta') 316 if 'phi' in param_list: 317 param_list.remove('phi') 315 318 316 319 rows = len(data) -
src/sas/qtgui/Utilities/GuiUtils.py
r9ce69ec ree22241 584 584 msg = "Attempt at opening an invalid URL" 585 585 raise AttributeError(msg) 586 587 def showHelp(url): 588 """ 589 Open a local url in the default browser 590 """ 591 location = HELP_DIRECTORY_LOCATION + url 592 #WP: Added to handle OSX bundle docs 593 if os.path.isdir(location) == False: 594 sas_path = os.path.abspath(os.path.dirname(sys.argv[0])) 595 location = sas_path+"/"+location 596 try: 597 webbrowser.open('file://' + os.path.realpath(location)) 598 except webbrowser.Error as ex: 599 logging.warning("Cannot display help. %s" % ex) 586 600 587 601 def retrieveData1d(data): -
src/sas/sascalc/calculator/resolution_calculator.py
rb8080e1 r30e0be0 1008 1008 detector_offset = self.sample2detector_distance[1] 1009 1009 except: 1010 logger.error(s ys.exc_value)1010 logger.error(str(sys.exc_info()[1])) 1011 1011 1012 1012 # detector size in [no of pix_x,no of pix_y] -
src/sas/sascalc/corfunc/corfunc_calculator.py
ra26f67f r6ae7466 88 88 # Only process data of the class Data1D 89 89 if not issubclass(data.__class__, Data1D): 90 raise ValueError(" Data must be of the type DataLoader.Data1D")90 raise ValueError("Correlation function cannot be computed with 2D Data.") 91 91 92 92 # Prepare the data
Note: See TracChangeset
for help on using the changeset viewer.