Changes in / [8eea1b1:20f4857] in sasview


Ignore:
Files:
1 added
1 deleted
16 edited

Legend:

Unmodified
Added
Removed
  • build_tools/conda_qt5_min_centos.yml

    r624c8747 r65e76ed  
    33  - conda-forge 
    44dependencies: 
    5  - matplotlib=2.1.0 
     5 - matplotlib=2 
    66 - scipy 
    77 - hdf5 
  • build_tools/conda_qt5_win.yml

    r624c8747 r65e76ed  
    44dependencies: 
    55 - python=3 
    6  - matplotlib==2.1.0 
     6 - matplotlib==2 
    77 - scipy 
    88 - hdf5 
  • src/sas/qtgui/MainWindow/GuiManager.py

    r20f4857 r20f4857  
    138138        self.categoryManagerWidget = CategoryManager(self._parent, manager=self) 
    139139        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  
    145140        self._workspace.toolBar.setVisible(LocalConfig.TOOLBAR_SHOW) 
    146141        self._workspace.actionHide_Toolbar.setText("Show Toolbar") 
     
    621616        Display/redisplay the batch fit viewer 
    622617        """ 
    623         self.grid_subwindow.setVisible(True) 
     618        if self.grid_window is None: 
     619            self.grid_window = BatchOutputPanel(parent=self, output_data=output_data) 
     620            subwindow = self._workspace.workspace.addSubWindow(self.grid_window) 
     621 
     622            #self.grid_window = BatchOutputPanel(parent=self, output_data=output_data) 
     623            self.grid_window.show() 
     624            return 
    624625        if output_data: 
    625626            self.grid_window.addFitResults(output_data) 
     627        self.grid_window.show() 
     628        if self.grid_window.windowState() == Qt.WindowMinimized: 
     629            self.grid_window.setWindowState(Qt.WindowActive) 
    626630 
    627631    def actionHide_Toolbar(self): 
  • src/sas/qtgui/MainWindow/UnitTesting/GuiManagerTest.py

    rfa762f4 r768387e0  
    6161        self.assertIsInstance(self.manager.ackWidget, Acknowledgements) 
    6262        self.assertIsInstance(self.manager.aboutWidget, AboutBox) 
    63         #self.assertIsInstance(self.manager.welcomePanel, WelcomePanel) 
     63        self.assertIsInstance(self.manager.welcomePanel, WelcomePanel) 
    6464 
    6565    def skip_testLogging(self): 
  • src/sas/qtgui/MainWindow/UnitTesting/MainWindowTest.py

    rfa762f4 r8353d90  
    4747        tmp_main.showMaximized() 
    4848        # See that only one subwindow is up 
    49         self.assertEqual(len(tmp_main.workspace.subWindowList()), 2) 
     49        self.assertEqual(len(tmp_main.workspace.subWindowList()), 1) 
    5050        # and that the subwindow is the fitting perspective 
    5151        self.assertIsInstance(tmp_main.workspace.subWindowList()[0].widget(), 
  • src/sas/qtgui/Perspectives/Fitting/FittingLogic.py

    ra54bbf2b ra54bbf2b  
    223223        return plots 
    224224 
    225     def getScalarIntermediateResults(self, return_data): 
    226         """ 
    227         Returns a dict of scalar-only intermediate results from the return data. 
    228         """ 
    229         res = {} 
    230         for name, int_res in return_data["intermediate_results"].items(): 
    231             if isinstance(int_res, np.ndarray): 
    232                 continue 
    233             res[name] = int_res 
    234         return res 
    235  
    236225    def computeDataRange(self): 
    237226        """ 
  • src/sas/qtgui/Perspectives/Fitting/FittingWidget.py

    r6d87082 r085409e3  
    321321        self.magneticAnglesWidget = QtWidgets.QWidget() 
    322322        labl = QtWidgets.QLabel(self.magneticAnglesWidget) 
    323         pixmap = QtGui.QPixmap(GuiUtils.IMAGES_DIRECTORY_LOCATION + '/M_angles_pic.png') 
     323        pixmap = QtGui.QPixmap(GuiUtils.IMAGES_DIRECTORY_LOCATION + '/M_angles_pic.bmp') 
    324324        labl.setPixmap(pixmap) 
    325325        self.magneticAnglesWidget.setFixedSize(pixmap.width(), pixmap.height()) 
     
    22972297        # TODO: multishell params in self.kernel_module.details[??] = value 
    22982298 
    2299         # handle display of effective radius parameter according to radius_effective_mode; pass ER into model if 
    2300         # necessary 
    2301         self.processEffectiveRadius() 
    2302  
    23032299        # Force the chart update when actual parameters changed 
    23042300        if model_column == 1: 
     
    23072303        # Update state stack 
    23082304        self.updateUndo() 
    2309  
    2310     def processEffectiveRadius(self): 
    2311         """ 
    2312         Checks the value of radius_effective_mode, if existent, and processes radius_effective as necessary. 
    2313         * mode == 0: This means 'unconstrained'; ensure use can specify ER. 
    2314         * mode > 0: This means it is constrained to a P(Q)-computed value in sasmodels; prevent user from editing ER. 
    2315  
    2316         Note: If ER has been computed, it is passed back to SasView as an intermediate result. That value must be 
    2317         displayed for the user; that is not dealt with here, but in complete1D. 
    2318         """ 
    2319         ER_row = self.getRowFromName("radius_effective") 
    2320         if ER_row is None: 
    2321             return 
    2322  
    2323         ER_mode_row = self.getRowFromName("radius_effective_mode") 
    2324         if ER_mode_row is None: 
    2325             return 
    2326  
    2327         try: 
    2328             ER_mode = int(self._model_model.item(ER_mode_row, 1).text()) 
    2329         except ValueError: 
    2330             logging.error("radius_effective_mode was set to an invalid value.") 
    2331             return 
    2332  
    2333         if ER_mode == 0: 
    2334             # ensure the ER value can be modified by user 
    2335             self.setParamEditableByRow(ER_row, True) 
    2336         elif ER_mode > 0: 
    2337             # ensure the ER value cannot be modified by user 
    2338             self.setParamEditableByRow(ER_row, False) 
    2339         else: 
    2340             logging.error("radius_effective_mode was set to an invalid value.") 
    2341  
    2342     def setParamEditableByRow(self, row, editable=True): 
    2343         """ 
    2344         Sets whether the user can edit a parameter in the table. If they cannot, the parameter name's font is changed, 
    2345         the value itself cannot be edited if clicked on, and the parameter may not be fitted. 
    2346         """ 
    2347         item_name = self._model_model.item(row, 0) 
    2348         item_value = self._model_model.item(row, 1) 
    2349  
    2350         item_value.setEditable(editable) 
    2351  
    2352         if editable: 
    2353             # reset font 
    2354             item_name.setFont(QtGui.QFont()) 
    2355             # reset colour 
    2356             item_name.setForeground(QtGui.QBrush()) 
    2357             # make checkable 
    2358             item_name.setCheckable(True) 
    2359         else: 
    2360             # change font 
    2361             font = QtGui.QFont() 
    2362             font.setItalic(True) 
    2363             item_name.setFont(font) 
    2364             # change colour 
    2365             item_name.setForeground(QtGui.QBrush(QtGui.QColor(50, 50, 50))) 
    2366             # make not checkable (and uncheck) 
    2367             item_name.setCheckState(QtCore.Qt.Unchecked) 
    2368             item_name.setCheckable(False) 
    23692305 
    23702306    def isCheckable(self, row): 
     
    25992535            self.communicate.plotUpdateSignal.emit([plot]) 
    26002536 
    2601         # Update radius_effective if relevant 
    2602         self.updateEffectiveRadius(return_data) 
    2603  
    26042537    def complete2D(self, return_data): 
    26052538        """ 
     
    26282561        for plot in new_plots: 
    26292562            self.communicate.plotUpdateSignal.emit([plot]) 
    2630  
    2631     def updateEffectiveRadius(self, return_data): 
    2632         """ 
    2633         Given return data from sasmodels, update the effective radius parameter in the GUI table with the new 
    2634         calculated value as returned by sasmodels (if the value was returned). 
    2635         """ 
    2636         ER_mode_row = self.getRowFromName("radius_effective_mode") 
    2637         if ER_mode_row is None: 
    2638             return 
    2639         try: 
    2640             ER_mode = int(self._model_model.item(ER_mode_row, 1).text()) 
    2641         except ValueError: 
    2642             logging.error("radius_effective_mode was set to an invalid value.") 
    2643             return 
    2644         if ER_mode < 1: 
    2645             # does not need updating if it is not being computed 
    2646             return 
    2647  
    2648         ER_row = self.getRowFromName("radius_effective") 
    2649         if ER_row is None: 
    2650             return 
    2651  
    2652         scalar_results = self.logic.getScalarIntermediateResults(return_data) 
    2653         ER_value = scalar_results.get("effective_radius") # note name of key 
    2654         if ER_value is None: 
    2655             return 
    2656         # ensure the model does not recompute when updating the value 
    2657         self._model_model.blockSignals(True) 
    2658         self._model_model.item(ER_row, 1).setText(str(ER_value)) 
    2659         self._model_model.blockSignals(False) 
    2660         # ensure the view is updated immediately 
    2661         self._model_model.layoutChanged.emit() 
    26622563 
    26632564    def calculateResiduals(self, fitted_data): 
  • src/sas/qtgui/Plotting/Plotter.py

    r34f13a83 r1f34e00  
    7575        if isinstance(data, Data1D): 
    7676            self.data = data 
    77  
    78         if not self._data: 
     77        if not self._data or data is None: 
    7978            return 
    8079 
  • src/sas/qtgui/Plotting/Plotter2D.py

    r34f13a83 r1f34e00  
    9595            self.data = data 
    9696 
    97         if not self._data: 
     97        if not self._data or data is None: 
    9898            return 
    9999 
  • src/sas/qtgui/Plotting/PlotterBase.py

    r34f13a83 r863ebca  
    114114        if not quickplot: 
    115115            # Add the toolbar 
    116             # self.toolbar.show() 
    117             self.toolbar.hide() # hide for the time being 
     116            self.toolbar.show() 
    118117            # Notify PlotHelper about the new plot 
    119118            self.upatePlotHelper() 
     
    221220        self.actionPrintImage = self.contextMenu.addAction("Print Image") 
    222221        self.actionCopyToClipboard = self.contextMenu.addAction("Copy to Clipboard") 
    223         #self.contextMenu.addSeparator() 
    224         #self.actionToggleMenu = self.contextMenu.addAction("Toggle Navigation Menu") 
     222        self.contextMenu.addSeparator() 
     223        self.actionToggleMenu = self.contextMenu.addAction("Toggle Navigation Menu") 
    225224        self.contextMenu.addSeparator() 
    226225 
     
    230229        self.actionPrintImage.triggered.connect(self.onImagePrint) 
    231230        self.actionCopyToClipboard.triggered.connect(self.onClipboardCopy) 
    232         #self.actionToggleMenu.triggered.connect(self.onToggleMenu) 
     231        self.actionToggleMenu.triggered.connect(self.onToggleMenu) 
    233232 
    234233    def createContextMenu(self): 
     
    382381        Toggle navigation menu visibility in the chart 
    383382        """ 
    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() 
     383        if self.toolbar.isVisible(): 
     384            self.toolbar.hide() 
     385        else: 
     386            self.toolbar.show() 
    391387 
    392388    def offset_graph(self): 
  • src/sas/qtgui/Plotting/UnitTesting/Plotter2DTest.py

    r34f13a83 r863ebca  
    146146        self.plotter.createContextMenuQuick() 
    147147        actions = self.plotter.contextMenu.actions() 
    148         self.assertEqual(len(actions), 7) 
     148        self.assertEqual(len(actions), 9) 
    149149 
    150150        # Trigger Print Image and make sure the method is called 
     
    158158 
    159159        # Trigger Toggle Grid and make sure the method is called 
    160         self.assertEqual(actions[4].text(), "Toggle Grid On/Off") 
     160        self.assertEqual(actions[6].text(), "Toggle Grid On/Off") 
    161161        self.plotter.ax.grid = MagicMock() 
    162         actions[4].trigger() 
     162        actions[6].trigger() 
    163163        self.assertTrue(self.plotter.ax.grid.called) 
    164164 
    165165        # 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() 
    168         actions[6].trigger() 
     166        self.assertEqual(actions[8].text(), "Toggle Linear/Log Scale") 
     167        FigureCanvas.draw_idle = MagicMock() 
     168        actions[8].trigger() 
    169169        self.assertTrue(FigureCanvas.draw_idle.called) 
    170170 
  • src/sas/qtgui/Plotting/UnitTesting/PlotterBaseTest.py

    r34f13a83 r863ebca  
    124124 
    125125        actions = self.plotter.contextMenu.actions() 
    126         self.assertEqual(len(actions), 4) 
     126        self.assertEqual(len(actions), 6) 
    127127 
    128128        # Trigger Print Image and make sure the method is called 
     
    147147        self.assertTrue(self.clipboard_called) 
    148148 
    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) 
     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) 
    159159 
    160160 
  • src/sas/qtgui/Plotting/UnitTesting/PlotterTest.py

    r34f13a83 r863ebca  
    103103        self.plotter.createContextMenuQuick() 
    104104        actions = self.plotter.contextMenu.actions() 
    105         self.assertEqual(len(actions), 7) 
     105        self.assertEqual(len(actions), 9) 
    106106 
    107107        # Trigger Print Image and make sure the method is called 
     
    115115 
    116116        # Trigger Toggle Grid and make sure the method is called 
    117         self.assertEqual(actions[4].text(), "Toggle Grid On/Off") 
     117        self.assertEqual(actions[6].text(), "Toggle Grid On/Off") 
    118118        self.plotter.ax.grid = MagicMock() 
    119         actions[4].trigger() 
     119        actions[6].trigger() 
    120120        self.assertTrue(self.plotter.ax.grid.called) 
    121121 
    122122        # Trigger Change Scale and make sure the method is called 
    123         self.assertEqual(actions[6].text(), "Change Scale") 
     123        self.assertEqual(actions[8].text(), "Change Scale") 
    124124        self.plotter.properties.exec_ = MagicMock(return_value=QtWidgets.QDialog.Rejected) 
    125         actions[6].trigger() 
     125        actions[8].trigger() 
    126126        self.assertTrue(self.plotter.properties.exec_.called) 
    127127 
  • src/sas/qtgui/Utilities/GridPanel.py

    rfa762f4 r7879745  
    1818    ERROR_COLUMN_CAPTION = " (Err)" 
    1919    IS_WIN = (sys.platform == 'win32') 
    20     windowClosedSignal = QtCore.pyqtSignal() 
    2120    def __init__(self, parent = None, output_data=None): 
    2221 
     
    5554        # Fill in the table from input data 
    5655        self.setupTable(widget=self.tblParams, data=output_data) 
     56        #TODO: This is not what was inteded to be. 
    5757        if output_data is not None: 
    5858            # Set a table tooltip describing the model 
     
    6464        Overwrite QDialog close method to allow for custom widget close 
    6565        """ 
    66         # notify the parent so it hides this window 
    67         self.windowClosedSignal.emit() 
     66        # Maybe we should just minimize 
     67        self.setWindowState(QtCore.Qt.WindowMinimized) 
    6868        event.ignore() 
    6969 
     
    153153        Create a new tab with batch fitting results 
    154154        """ 
    155         if self.has_data: 
    156             self.addTabPage() 
     155        self.addTabPage() 
    157156        # Update the new widget 
    158157        # Fill in the table from input data in the last/newest page 
  • src/sas/qtgui/Utilities/GuiUtils.py

    r20f4857 r20f4857  
    2929from sas.qtgui.Utilities import CustomDir 
    3030 
     31## TODO: CHANGE FOR SHIPPED PATH IN RELEASE 
    3132if os.path.splitext(sys.argv[0])[1].lower() != ".py": 
    3233        HELP_DIRECTORY_LOCATION = "doc" 
  • src/sas/qtgui/Utilities/LocalConfig.py

    r6d87082 rb764ae5  
    7373_nsf_logo = os.path.join(icon_path, "nsf_logo.png") 
    7474_danse_logo = os.path.join(icon_path, "danse_logo.png") 
    75 _inst_logo = os.path.join(icon_path, "utlogo.png") 
     75_inst_logo = os.path.join(icon_path, "utlogo.gif") 
    7676_nist_url = "http://www.nist.gov/" 
    7777_umd_url = "http://www.umd.edu/" 
Note: See TracChangeset for help on using the changeset viewer.