Changeset 2327399 in sasview for src


Ignore:
Timestamp:
Dec 4, 2018 9:22:17 AM (6 years ago)
Author:
wojciech
Branches:
ESS_GUI, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_sync_sascalc
Children:
3801429
Parents:
a8e6394 (diff), 0989bad (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.
Message:

Merge branch 'ESS_GUI' of https://github.com/SasView/sasview into ESS_GUI

Location:
src/sas/qtgui
Files:
1 added
11 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/MainWindow/DataExplorer.py

    rd9e7792 r99f8760  
    354354            properties['checked'] = is_checked 
    355355            other_datas = [] 
    356             # no need to save other_datas - things will be refit on read 
    357             #other_datas = GuiUtils.plotsFromFilename(filename, model) 
     356            # save underlying theories 
     357            other_datas = GuiUtils.plotsFromFilename(filename, model) 
    358358            # skip the main plot 
    359             #other_datas = list(other_datas.values())[1:] 
     359            other_datas = list(other_datas.values())[1:] 
    360360            all_data[data.id] = [data, properties, other_datas] 
    361361        return all_data 
     
    457457            if key=='is_batch': 
    458458                self.chkBatch.setChecked(True if value=='True' else False) 
     459                if 'batch_grid' not in all_data: 
     460                    continue 
     461                grid_pages = all_data['batch_grid'] 
     462                for grid_name, grid_page in grid_pages.items(): 
     463                    grid_page.append(grid_name) 
     464                    self.parent.showBatchOutput(grid_page) 
    459465                continue 
    460466            if 'cs_tab' in key: 
  • src/sas/qtgui/MainWindow/GuiManager.py

    rd9e7792 r99f8760  
    588588            if id=='is_batch': 
    589589                analysis['is_batch'] = data 
     590                analysis['batch_grid'] = self.grid_window.data_dict 
    590591                continue 
    591592            data_content = {"fit_data":data} 
     
    710711        """ 
    711712        self.grid_subwindow.setVisible(True) 
     713        self.grid_subwindow.raise_() 
    712714        if output_data: 
    713715            self.grid_window.addFitResults(output_data) 
  • src/sas/qtgui/MainWindow/UI/MainWindowUI.ui

    rd9e7792 r0989bad  
    22<ui version="4.0"> 
    33 <class>MainWindow</class> 
    4  <widget class="QMainWindow" name="MainWindow"> 
     4 <widget class="QMainWindow" name="SasView"> 
    55  <property name="geometry"> 
    66   <rect> 
     
    1212  </property> 
    1313  <property name="windowTitle"> 
    14    <string>MainWindow</string> 
     14   <string>SasView</string> 
    1515  </property> 
    1616  <property name="windowIcon"> 
  • src/sas/qtgui/MainWindow/UnitTesting/DataExplorerTest.py

    rb1b71ad r0989bad  
    331331        time.sleep(1) 
    332332        # Unselect all data 
    333         self.form.cbSelect.setCurrentIndex(1) 
    334  
     333        self.form.cbSelect.activated.emit(1) 
    335334        # Test the current selection 
    336335        item1D = self.form.model.item(0) 
     
    341340 
    342341        # Select all data 
    343         self.form.cbSelect.setCurrentIndex(0) 
     342        self.form.cbSelect.activated.emit(0) 
    344343 
    345344        # Test the current selection 
     
    348347 
    349348        # select 1d data 
    350         self.form.cbSelect.setCurrentIndex(2) 
    351  
     349        self.form.cbSelect.activated.emit(2) 
    352350        # Test the current selection 
    353351        self.assertTrue(item1D.checkState() == Qt.Checked) 
     
    355353 
    356354        # unselect 1d data 
    357         self.form.cbSelect.setCurrentIndex(3) 
     355        self.form.cbSelect.activated.emit(3) 
    358356 
    359357        # Test the current selection 
     
    362360 
    363361        # select 2d data 
    364         self.form.cbSelect.setCurrentIndex(4) 
     362        self.form.cbSelect.activated.emit(4) 
    365363 
    366364        # Test the current selection 
     
    369367 
    370368        # unselect 2d data 
    371         self.form.cbSelect.setCurrentIndex(5) 
     369        self.form.cbSelect.activated.emit(5) 
    372370 
    373371        # Test the current selection 
    374372        self.assertTrue(item1D.checkState() == Qt.Unchecked) 
    375373        self.assertTrue(item2D.checkState() == Qt.Unchecked)         
    376  
    377         # choose impossible index and assure the code raises 
    378         #with self.assertRaises(Exception): 
    379         #    self.form.cbSelect.setCurrentIndex(6) 
    380374 
    381375    def testFreezeTheory(self): 
     
    581575 
    582576        # Call the plotting method 
    583         self.form.newPlot() 
    584  
    585         QApplication.processEvents() 
     577        #self.form.newPlot() 
     578        #QApplication.processEvents() 
    586579 
    587580        # The plot was registered 
    588         self.assertEqual(len(PlotHelper.currentPlots()), 1) 
    589  
    590         self.assertTrue(self.form.cbgraph.isEnabled()) 
    591         self.assertTrue(self.form.cmdAppend.isEnabled()) 
     581        #self.assertEqual(len(PlotHelper.currentPlots()), 1) 
     582 
     583        #self.assertTrue(self.form.cbgraph.isEnabled()) 
     584        #self.assertTrue(self.form.cmdAppend.isEnabled()) 
    592585 
    593586    @patch('sas.qtgui.Utilities.GuiUtils.plotsFromCheckedItems') 
  • src/sas/qtgui/MainWindow/UnitTesting/GuiManagerTest.py

    r7385fec r0989bad  
    147147        """ 
    148148        self.manager.processVersion = MagicMock() 
    149         version = {'update_url'  : 'http://www.sasview.org/sasview.latestversion',  
    150                    'version'     : '4.1.2', 
     149        version = {'version'     : '4.2.0', 
     150                   'update_url'  : 'http://www.sasview.org/sasview.latestversion',  
    151151                   'download_url': 'https://github.com/SasView/sasview/releases'} 
    152152        self.manager.checkUpdate() 
  • src/sas/qtgui/MainWindow/UnitTesting/MainWindowTest.py

    r63467b6 r0989bad  
    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()), 3) 
    5050        # and that the subwindow is the fitting perspective 
    5151        self.assertIsInstance(tmp_main.workspace.subWindowList()[0].widget(), 
     
    5454        tmp_main.guiManager.showWelcomeMessage() 
    5555        # Assure it is visible and a part of the MdiArea 
    56         self.assertEqual(len(tmp_main.workspace.subWindowList()), 2) 
     56        self.assertEqual(len(tmp_main.workspace.subWindowList()), 3) 
    5757 
    5858        tmp_main.close() 
  • src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingWidgetTest.py

    rbaeac95 r0989bad  
    533533        # check values - unchanged since the file doesn't exist 
    534534        self.assertTrue(self.widget._poly_model.item(0, 1).isEnabled()) 
    535         with self.assertRaises(AttributeError): 
    536             self.widget.disp_model() 
    537535 
    538536        # good file 
  • src/sas/qtgui/Plotting/UnitTesting/PlotterTest.py

    r34f13a83 r0989bad  
    5757        self.plotter.data = self.data 
    5858        self.plotter.show() 
    59         FigureCanvas.draw = MagicMock() 
     59        FigureCanvas.draw_idle = MagicMock() 
    6060 
    6161        self.plotter.plot(hide_error=False) 
    6262 
    6363        self.assertEqual(self.plotter.ax.get_xscale(), 'log') 
    64         self.assertTrue(FigureCanvas.draw.called) 
     64        self.assertTrue(FigureCanvas.draw_idle.called) 
    6565 
    6666        self.plotter.figure.clf() 
     
    7070        self.plotter.data = self.data 
    7171        self.plotter.show() 
    72         FigureCanvas.draw = MagicMock() 
     72        FigureCanvas.draw_idle = MagicMock() 
    7373 
    7474        self.plotter.plot(hide_error=True) 
    7575 
    7676        self.assertEqual(self.plotter.ax.get_yscale(), 'log') 
    77         self.assertTrue(FigureCanvas.draw.called) 
     77        self.assertTrue(FigureCanvas.draw_idle.called) 
    7878        self.plotter.figure.clf() 
    7979 
     
    9191        self.plotter.data = data 
    9292        self.plotter.show() 
    93         FigureCanvas.draw = MagicMock() 
     93        FigureCanvas.draw_idle = MagicMock() 
    9494 
    9595        self.plotter.plot(hide_error=True) 
     
    9797        self.assertEqual(self.plotter.ax.get_xscale(), 'linear') 
    9898        self.assertEqual(self.plotter.ax.get_yscale(), 'linear') 
    99         self.assertTrue(FigureCanvas.draw.called) 
     99        self.assertTrue(FigureCanvas.draw_idle.called) 
    100100 
    101101    def testCreateContextMenuQuick(self): 
  • src/sas/qtgui/Utilities/GridPanel.py

    ra8e6394 r2327399  
    3636        # Tab numbering 
    3737        self.tab_number = 1 
     38 
     39        # save state 
     40        self.data_dict = {} 
    3841 
    3942        # System dependent menu items 
     
    176179        model_name = results[0][0].model.id 
    177180        self.tabWidget.setTabToolTip(self.tabWidget.count()-1, model_name) 
    178  
     181        self.data_dict[page_name] = results 
    179182 
    180183    @classmethod 
  • src/sas/qtgui/Utilities/GuiUtils.py

    r133812c7 r99f8760  
    3636from sas.qtgui.Plotting.Plottables import Chisq 
    3737from sas.qtgui.MainWindow.DataState import DataState 
     38 
     39from sas.sascalc.fit.AbstractFitEngine import FResult 
     40from sas.sascalc.fit.AbstractFitEngine import FitData1D, FitData2D 
     41from sasmodels.sasview_model import SasviewModel 
    3842 
    3943from sas.sascalc.dataloader.loader import Loader 
     
    11751179 
    11761180        # "simple" types 
    1177         if isinstance(o, (Sample, Source, Vector)): 
     1181        if isinstance(o, (Sample, Source, Vector, FResult)): 
    11781182            return add_type(o.__dict__, type(o)) 
    11791183        if isinstance(o, (Plottable, View)): 
    11801184            return add_type(o.__dict__, type(o)) 
    11811185 
     1186        # SasviewModel - unique 
     1187        if isinstance(o, SasviewModel): 
     1188            # don't store parent 
     1189            content = o.__dict__.copy() 
     1190            return add_type(content, SasviewModel) 
     1191 
    11821192        # DataState 
    1183         if isinstance(o, (Data1D, Data2D)): 
     1193        if isinstance(o, (Data1D, Data2D, FitData1D, FitData2D)): 
    11841194            # don't store parent 
    11851195            content = o.__dict__.copy() 
     
    12101220        Sample, Source, Vector, 
    12111221        Plottable, Data1D, Data2D, PlottableTheory1D, PlottableFit1D, Text, Chisq, View, 
    1212         DataState, np.ndarray] 
     1222        DataState, np.ndarray, FResult, FitData1D, FitData2D, SasviewModel] 
    12131223 
    12141224    lookup = dict((cls.__name__, cls) for cls in supported) 
     
    12421252 
    12431253        # "simple" types 
    1244         if cls in (Sample, Source, Vector): 
     1254        if cls in (Sample, Source, Vector, FResult, FitData1D, FitData2D, SasviewModel): 
    12451255            return simple_type(cls, data, level) 
    12461256        if issubclass(cls, Plottable) or (cls == View): 
  • src/sas/qtgui/Perspectives/Invariant/InvariantPerspective.py

    r6ae7466 r11a336f  
    348348                extrapolated_data.name = title 
    349349                extrapolated_data.title = title 
    350                 extrapolated_data.style = "Line" 
     350                extrapolated_data.symbol = "Line" 
    351351                extrapolated_data.has_errors = False 
    352                 extrapolated_data.plot_role = Data1D.ROLE_DEFAULT 
    353352 
    354353                # copy labels and units of axes for plotting 
     
    382381                high_out_data.name = title 
    383382                high_out_data.title = title 
    384                 high_out_data.style = "Line" 
     383                high_out_data.symbol = "Line" 
    385384                high_out_data.has_errors = False 
    386                 high_out_data.plot_role = Data1D.ROLE_DEFAULT 
    387385 
    388386                # copy labels and units of axes for plotting 
Note: See TracChangeset for help on using the changeset viewer.