Changeset dc57b4f in sasview


Ignore:
Timestamp:
Oct 25, 2017 5:38:11 AM (2 years ago)
Author:
Adam Washington <adam.washington@…>
Children:
505357a
Parents:
4a9786d8 (diff), f7d14a1 (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 github.com:SasView/sasview into ESS_Corfunc

Location:
src/sas
Files:
5 added
5 edited

Legend:

Unmodified
Added
Removed
  • src/sas/_config.py

    r88e1f57 rf7d14a1  
    110110        try: 
    111111            module = load_module_from_path('sas.custom_config', path) 
    112             logger.info("GuiManager loaded %s", path) 
     112            #logger.info("GuiManager loaded %s", path) 
    113113            return module 
    114114        except Exception as exc: 
  • src/sas/qtgui/MainWindow/UnitTesting/DataExplorerTest.py

    r88e1f57 rf7d14a1  
    3737            def allowBatch(self): 
    3838                return False 
    39             def setData(self, data_item=None): 
     39            def setData(self, data_item=None, is_batch=False): 
    4040                return None 
    4141            def title(self): 
     
    170170 
    171171        # Populate the model 
    172         #filename = ["cyl_400_20.txt", "P123_D2O_10_percent.dat", "cyl_400_20.txt"] 
    173         filename = ["cyl_400_20.txt", "cyl_400_20.txt", "P123_D2O_10_percent.dat"] 
     172        filename = ["cyl_400_20.txt", "cyl_400_20.txt", "cyl_400_20.txt"] 
    174173        self.form.readData(filename) 
    175  
    176         self.form.show() 
    177         app.exec_() 
    178174 
    179175        # Assure the model contains three items 
  • src/sas/qtgui/Perspectives/Fitting/FittingWidget.py

    r5d1440e1 rf7d14a1  
    146146    def data(self, value): 
    147147        """ data setter """ 
     148        # Value is either a list of indices for batch fitting or a simple index 
     149        # for standard fitting. Assure we have a list, regardless. 
    148150        if isinstance(value, list): 
    149151            self.is_batch_fitting = True 
     
    159161 
    160162        # Update logics with data items 
     163        # Logics.data contains only a single Data1D/Data2D object 
    161164        self.logic.data = GuiUtils.dataFromItem(value[0]) 
    162165 
     
    164167        self.is2D = True if isinstance(self.logic.data, Data2D) else False 
    165168 
     169        # Let others know we're full of data now 
    166170        self.data_is_loaded = True 
    167171 
     
    343347        self.chk2DView.setVisible(False) 
    344348        self.chkMagnetism.setEnabled(self.is2D) 
     349        self.tabFitting.setTabEnabled(TAB_MAGNETISM, self.is2D) 
    345350        # Combo box or label for file name" 
    346351        if self.is_batch_fitting: 
     
    354359        # Similarly on other tabs 
    355360        self.options_widget.setEnablementOnDataLoad() 
     361 
     362        # Reload the model 
     363        self.onSelectModel() 
    356364 
    357365        # Smearing tab 
  • src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingWidgetTest.py

    rc7358b2 rf7d14a1  
    2020from sas.qtgui.Plotting.PlotterData import Data2D 
    2121 
    22 if not QtGui.QApplication.instance(): 
    23     app = QtGui.QApplication(sys.argv) 
     22#if not QtGui.QApplication.instance(): 
     23app = QtGui.QApplication(sys.argv) 
    2424 
    2525class dummy_manager(object): 
     
    784784        self.assertEqual(self.widget.cbModel.currentText(), 'onion') 
    785785        self.assertTrue(self.widget.chkPolydispersity.isChecked()) 
     786        #Check if polidispersity tab is available 
     787        self.assertTrue(self.widget.tabFitting.isTabEnabled(3)) 
     788 
     789        #Check if magnetism box and tab are disabled when 1D data is loaded 
     790        self.assertFalse(self.widget.chkMagnetism.isEnabled()) 
     791        self.assertFalse(self.widget.tabFitting.isTabEnabled(4)) 
     792 
     793    def testReadFitPage2D(self): 
     794        """ 
     795        Read in the fitpage object and restore state 
     796        """ 
     797        # Set data 
     798 
     799        test_data = Data2D(image=[1.0, 2.0, 3.0], 
     800                           err_image=[0.01, 0.02, 0.03], 
     801                           qx_data=[0.1, 0.2, 0.3], 
     802                           qy_data=[0.1, 0.2, 0.3], 
     803                           xmin=0.1, xmax=0.3, ymin=0.1, ymax=0.3, 
     804                           mask=[True, True, True]) 
     805 
     806        # Force same data into logic 
     807        self.widget.logic.data = test_data 
     808        self.widget.data_is_loaded = True 
     809 
     810        #item = QtGui.QStandardItem() 
     811        #updateModelItem(item, [test_data], "test") 
     812        # Force same data into logic 
     813        #self.widget.logic.data = item 
     814        #self.widget.data_is_loaded = True 
     815 
     816        category_index = self.widget.cbCategory.findText("Cylinder") 
     817        self.widget.cbCategory.setCurrentIndex(category_index) 
     818 
     819        # Test no fitting params 
     820        self.widget.parameters_to_fit = ['scale'] 
     821 
     822        # Invoke the tested method 
     823        fp = self.widget.currentState() 
     824 
     825        # Prepare modified fit page 
     826        fp.current_model = 'cylinder' 
     827        fp.is_polydisperse = True 
     828        fp.is_magnetic = True 
     829        fp.is2D = True 
     830 
     831        # Read in modified state 
     832        self.widget.readFitPage(fp) 
     833 
     834        # Check if the widget got updated accordingly 
     835        self.assertEqual(self.widget.cbModel.currentText(), 'cylinder') 
     836        self.assertTrue(self.widget.chkPolydispersity.isChecked()) 
     837        self.assertTrue(self.widget.chkPolydispersity.isEnabled()) 
     838        #Check if polidispersity tab is available 
     839        self.assertTrue(self.widget.tabFitting.isTabEnabled(3)) 
     840 
     841        #Check if magnetism box and tab are disabled when 1D data is loaded 
     842        self.assertTrue(self.widget.chkMagnetism.isChecked()) 
     843        self.assertTrue(self.widget.chkMagnetism.isEnabled()) 
     844        self.assertTrue(self.widget.tabFitting.isTabEnabled(4)) 
    786845 
    787846    def testCurrentState(self): 
  • src/sas/qtgui/Perspectives/__init__.py

    r7adc2a8 r6d96bf9  
    44from Fitting.FittingPerspective import FittingWindow 
    55from Invariant.InvariantPerspective import InvariantWindow 
     6from Corfunc.CorfuncPerspective import CorfuncWindow 
    67 
    78PERSPECTIVES = { 
    89    FittingWindow.name: FittingWindow, 
    910    InvariantWindow.name: InvariantWindow, 
     11    CorfuncWindow.name: CorfuncWindow, 
    1012} 
Note: See TracChangeset for help on using the changeset viewer.