Changes in / [dc57b4f:4a9786d8] in sasview
- Location:
- src/sas
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/_config.py
rf7d14a1 r88e1f57 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
rf7d14a1 r88e1f57 37 37 def allowBatch(self): 38 38 return False 39 def setData(self, data_item=None , is_batch=False):39 def setData(self, data_item=None): 40 40 return None 41 41 def title(self): … … 170 170 171 171 # Populate the model 172 filename = ["cyl_400_20.txt", "cyl_400_20.txt", "cyl_400_20.txt"] 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"] 173 174 self.form.readData(filename) 175 176 self.form.show() 177 app.exec_() 174 178 175 179 # Assure the model contains three items -
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
rf7d14a1 r5d1440e1 146 146 def data(self, value): 147 147 """ data setter """ 148 # Value is either a list of indices for batch fitting or a simple index149 # for standard fitting. Assure we have a list, regardless.150 148 if isinstance(value, list): 151 149 self.is_batch_fitting = True … … 161 159 162 160 # Update logics with data items 163 # Logics.data contains only a single Data1D/Data2D object164 161 self.logic.data = GuiUtils.dataFromItem(value[0]) 165 162 … … 167 164 self.is2D = True if isinstance(self.logic.data, Data2D) else False 168 165 169 # Let others know we're full of data now170 166 self.data_is_loaded = True 171 167 … … 347 343 self.chk2DView.setVisible(False) 348 344 self.chkMagnetism.setEnabled(self.is2D) 349 self.tabFitting.setTabEnabled(TAB_MAGNETISM, self.is2D)350 345 # Combo box or label for file name" 351 346 if self.is_batch_fitting: … … 359 354 # Similarly on other tabs 360 355 self.options_widget.setEnablementOnDataLoad() 361 362 # Reload the model363 self.onSelectModel()364 356 365 357 # Smearing tab -
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingWidgetTest.py
rf7d14a1 rc7358b2 20 20 from sas.qtgui.Plotting.PlotterData import Data2D 21 21 22 #if not QtGui.QApplication.instance():23 app = QtGui.QApplication(sys.argv)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 available787 self.assertTrue(self.widget.tabFitting.isTabEnabled(3))788 789 #Check if magnetism box and tab are disabled when 1D data is loaded790 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 state796 """797 # Set data798 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 logic807 self.widget.logic.data = test_data808 self.widget.data_is_loaded = True809 810 #item = QtGui.QStandardItem()811 #updateModelItem(item, [test_data], "test")812 # Force same data into logic813 #self.widget.logic.data = item814 #self.widget.data_is_loaded = True815 816 category_index = self.widget.cbCategory.findText("Cylinder")817 self.widget.cbCategory.setCurrentIndex(category_index)818 819 # Test no fitting params820 self.widget.parameters_to_fit = ['scale']821 822 # Invoke the tested method823 fp = self.widget.currentState()824 825 # Prepare modified fit page826 fp.current_model = 'cylinder'827 fp.is_polydisperse = True828 fp.is_magnetic = True829 fp.is2D = True830 831 # Read in modified state832 self.widget.readFitPage(fp)833 834 # Check if the widget got updated accordingly835 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 available839 self.assertTrue(self.widget.tabFitting.isTabEnabled(3))840 841 #Check if magnetism box and tab are disabled when 1D data is loaded842 self.assertTrue(self.widget.chkMagnetism.isChecked())843 self.assertTrue(self.widget.chkMagnetism.isEnabled())844 self.assertTrue(self.widget.tabFitting.isTabEnabled(4))845 786 846 787 def testCurrentState(self):
Note: See TracChangeset
for help on using the changeset viewer.