- Timestamp:
- Oct 25, 2017 5:38:11 AM (7 years ago)
- 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. - Location:
- src/sas
- Files:
-
- 5 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/_config.py
r88e1f57 rf7d14a1 110 110 try: 111 111 module = load_module_from_path('sas.custom_config', path) 112 logger.info("GuiManager loaded %s", path)112 #logger.info("GuiManager loaded %s", path) 113 113 return module 114 114 except Exception as exc: -
src/sas/qtgui/MainWindow/UnitTesting/DataExplorerTest.py
r88e1f57 rf7d14a1 37 37 def allowBatch(self): 38 38 return False 39 def setData(self, data_item=None ):39 def setData(self, data_item=None, is_batch=False): 40 40 return None 41 41 def title(self): … … 170 170 171 171 # 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"] 174 173 self.form.readData(filename) 175 176 self.form.show()177 app.exec_()178 174 179 175 # Assure the model contains three items -
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r5d1440e1 rf7d14a1 146 146 def data(self, value): 147 147 """ 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. 148 150 if isinstance(value, list): 149 151 self.is_batch_fitting = True … … 159 161 160 162 # Update logics with data items 163 # Logics.data contains only a single Data1D/Data2D object 161 164 self.logic.data = GuiUtils.dataFromItem(value[0]) 162 165 … … 164 167 self.is2D = True if isinstance(self.logic.data, Data2D) else False 165 168 169 # Let others know we're full of data now 166 170 self.data_is_loaded = True 167 171 … … 343 347 self.chk2DView.setVisible(False) 344 348 self.chkMagnetism.setEnabled(self.is2D) 349 self.tabFitting.setTabEnabled(TAB_MAGNETISM, self.is2D) 345 350 # Combo box or label for file name" 346 351 if self.is_batch_fitting: … … 354 359 # Similarly on other tabs 355 360 self.options_widget.setEnablementOnDataLoad() 361 362 # Reload the model 363 self.onSelectModel() 356 364 357 365 # Smearing tab -
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingWidgetTest.py
rc7358b2 rf7d14a1 20 20 from sas.qtgui.Plotting.PlotterData import Data2D 21 21 22 if not QtGui.QApplication.instance():23 22 #if not QtGui.QApplication.instance(): 23 app = QtGui.QApplication(sys.argv) 24 24 25 25 class dummy_manager(object): … … 784 784 self.assertEqual(self.widget.cbModel.currentText(), 'onion') 785 785 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)) 786 845 787 846 def testCurrentState(self): -
src/sas/qtgui/Perspectives/__init__.py
r7adc2a8 r6d96bf9 4 4 from Fitting.FittingPerspective import FittingWindow 5 5 from Invariant.InvariantPerspective import InvariantWindow 6 from Corfunc.CorfuncPerspective import CorfuncWindow 6 7 7 8 PERSPECTIVES = { 8 9 FittingWindow.name: FittingWindow, 9 10 InvariantWindow.name: InvariantWindow, 11 CorfuncWindow.name: CorfuncWindow, 10 12 }
Note: See TracChangeset
for help on using the changeset viewer.