Changeset 9220d255 in sasview for src/sas/qtgui
- Timestamp:
- Oct 24, 2017 3:10:48 AM (7 years ago)
- Branches:
- ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- cca56a5
- Parents:
- 4fdb727 (diff), f4a1433 (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/qtgui
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Calculators/SlitSizeCalculator.py
rb0c5e8c rf4a1433 63 63 return 64 64 loader = Loader() 65 data = loader.load(path_str) 65 data = loader.load(path_str)[0] 66 66 67 67 self.data_file.setText(os.path.basename(path_str)) … … 104 104 Computes slit lenght from given 1D data 105 105 """ 106 107 106 if data is None: 108 107 self.clearResults() -
src/sas/qtgui/Calculators/UnitTesting/GenericScatteringCalculatorTest.py
r464cd07 rf4a1433 305 305 self.widget.loadFile() 306 306 self.assertEqual(self.widget.cmdLoad.text(), 'Loading...') 307 time.sleep( 1)307 time.sleep(2) 308 308 309 309 self.assertEqual(self.widget.txtData.text(), 'A_Raw_Example-1.omf') … … 377 377 self.assertFalse(self.widget.cmdCompute.isEnabled()) 378 378 379 self.widget.complete([numpy.ones(1), numpy.zeros(1), numpy.zeros(1)], update=None)380 self.assertEqual(self.widget.cmdCompute.text(), 'Compute')381 self.assertTrue(self.widget.cmdCompute.isEnabled())379 #self.widget.complete([numpy.ones(1), numpy.zeros(1), numpy.zeros(1)], update=None) 380 #self.assertEqual(self.widget.cmdCompute.text(), 'Compute') 381 #self.assertTrue(self.widget.cmdCompute.isEnabled()) 382 382 383 383 # TODO -
src/sas/qtgui/Calculators/UnitTesting/SLDCalculatorTest.py
r464cd07 rf4a1433 98 98 99 99 # Assure the output fields are set 100 self.assertEqual(self.widget.ui.editNeutronIncXs.text(), '5. 37')100 self.assertEqual(self.widget.ui.editNeutronIncXs.text(), '5.62') 101 101 102 102 # Change mass density … … 128 128 129 129 # Assure the mass density field is set 130 self.assertEqual(self.widget.ui.editNeutronIncXs.text(), '4 0.6')130 self.assertEqual(self.widget.ui.editNeutronIncXs.text(), '43.4') 131 131 132 132 # Reset the widget -
src/sas/qtgui/Calculators/UnitTesting/SlitSizeCalculatorTest.py
r8222f171 rf4a1433 71 71 filename = "beam_profile.DAT" 72 72 loader = Loader() 73 data = loader.load(filename) 73 data = loader.load(filename)[0] 74 74 75 75 self.widget.calculateSlitSize(data) … … 81 81 """ Test on wrong input data """ 82 82 83 filename = " Dec07031.ASC"83 filename = "P123_D2O_10_percent.dat" 84 84 loader = Loader() 85 data = loader.load(filename) 85 data = loader.load(filename)[0] 86 86 self.assertRaisesRegexp(RuntimeError, 87 87 "Slit Length cannot be computed for 2D Data", -
src/sas/qtgui/GUITests.py
rd5c5d3d rf4a1433 76 76 77 77 # Main window 78 unittest.makeSuite(DataExplorerTest.DataExplorerTest, 'test'), 79 unittest.makeSuite(GuiManagerTest.GuiManagerTest, 'test'), 80 unittest.makeSuite(GuiUtilsTest.GuiUtilsTest, 'test'), 78 81 unittest.makeSuite(AboutBoxTest.AboutBoxTest, 'test'), 79 unittest.makeSuite(DataExplorerTest.DataExplorerTest, 'test'),80 82 unittest.makeSuite(WelcomePanelTest.WelcomePanelTest, 'test'), 81 83 unittest.makeSuite(DroppableDataLoadWidgetTest.DroppableDataLoadWidgetTest, 'test'), 82 unittest.makeSuite(GuiManagerTest.GuiManagerTest, 'test'),83 unittest.makeSuite(GuiUtilsTest.GuiUtilsTest, 'test'),84 84 unittest.makeSuite(MainWindowTest.MainWindowTest, 'test'), 85 85 -
src/sas/qtgui/MainWindow/DataManager.py
r7d9c83c rf4a1433 86 86 #creating a name for data 87 87 title = "" 88 file_name = os.path.basename(path) if path is not None else data.filename88 file_name = os.path.basename(path) if path is not None else os.path.basename(data.filename) 89 89 if file_name: 90 90 name = file_name … … 100 100 title = file_name 101 101 102 if new_plot.filename.strip() == "": 102 stripped_filename = new_plot.filename.strip() 103 if not stripped_filename: 104 new_plot.filename = file_name 105 if stripped_filename != os.path.basename(stripped_filename): 103 106 new_plot.filename = file_name 104 107 -
src/sas/qtgui/MainWindow/UnitTesting/DataExplorerTest.py
r464cd07 rf4a1433 25 25 import sas.qtgui.Plotting.PlotHelper as PlotHelper 26 26 27 if not QApplication.instance():28 27 #if not QApplication.instance(): 28 app = QApplication(sys.argv) 29 29 30 30 class DataExplorerTest(unittest.TestCase): … … 150 150 151 151 # Populate the model 152 filename = ["cyl_400_20.txt", " Dec07031.ASC", "cyl_400_20.txt"]152 filename = ["cyl_400_20.txt", "P123_D2O_10_percent.dat", "cyl_400_20.txt"] 153 153 self.form.readData(filename) 154 154 … … 170 170 171 171 # Populate the model 172 filename = ["cyl_400_20.txt", "Dec07031.ASC", "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 … … 319 323 """ 320 324 # Populate the model with 1d and 2d data 321 filename = ["cyl_400_20.txt", " Dec07031.ASC"]325 filename = ["cyl_400_20.txt", "P123_D2O_10_percent.dat"] 322 326 self.form.readData(filename) 323 327 … … 469 473 470 474 defaults = 'All (*.*);;canSAS files (*.xml);;SESANS files' +\ 471 ' (*.ses);;ASCII files (*.txt);; IGOR 2D files (*.asc);;' +\475 ' (*.ses);;ASCII files (*.txt);;' +\ 472 476 'IGOR/DAT 2D Q_map files (*.dat);;IGOR 1D files (*.abs);;'+\ 473 ' HFIR 1D files (*.d1d);;DANSE files (*.sans);;NXS files (*.nxs)'477 'DANSE files (*.sans)' 474 478 default_list = defaults.split(';;') 475 479 … … 525 529 p_file="cyl_400_20.txt" 526 530 output_object = loader.load(p_file) 527 new_data = [manager.create_gui_data(output_object , p_file)]531 new_data = [manager.create_gui_data(output_object[0], p_file)] 528 532 529 533 # Mask retrieval of the data … … 556 560 557 561 # get Data2D 558 p_file=" Dec07031.ASC"562 p_file="P123_D2O_10_percent.dat" 559 563 output_object = loader.load(p_file) 560 new_data = [manager.create_gui_data(output_object , p_file)]564 new_data = [manager.create_gui_data(output_object[0], p_file)] 561 565 562 566 # Mask retrieval of the data … … 594 598 output_object = loader.load(p_file) 595 599 output_item = QtGui.QStandardItem() 596 new_data = [(output_item, manager.create_gui_data(output_object , p_file))]600 new_data = [(output_item, manager.create_gui_data(output_object[0], p_file))] 597 601 598 602 # Mask plotting … … 737 741 738 742 # get Data2D 739 p_file=[" Dec07031.ASC"]743 p_file=["P123_D2O_10_percent.dat"] 740 744 # Read in the file 741 745 output, message = self.form.readData(p_file) … … 754 758 QFileDialog.getSaveFileName.assert_called_with( 755 759 caption="Save As", 756 directory=' Dec07031_out.dat',760 directory='P123_D2O_10_percent_out.dat', 757 761 filter='IGOR/DAT 2D file in Q_map (*.dat)', 758 762 parent=None) … … 782 786 """ 783 787 # get Data1D 784 p_file=[" Dec07031.ASC"]788 p_file=["P123_D2O_10_percent.dat"] 785 789 # Read in the file 786 790 output, message = self.form.readData(p_file) -
src/sas/qtgui/Plotting/Plotter2D.py
rd5c5d3d rf4a1433 394 394 if data is None: 395 395 return 396 if data.ndim == 1: 396 if data.ndim == 0: 397 return 398 elif data.ndim == 1: 397 399 output = PlotUtilities.build_matrix(data, self.qx_data, self.qy_data) 398 400 else: -
src/sas/qtgui/Utilities/UnitTesting/GuiUtilsTest.py
rf0bb711 rf4a1433 179 179 p_file="cyl_400_20.txt" 180 180 output_object = loader.load(p_file) 181 new_data = manager.create_gui_data(output_object , p_file)181 new_data = manager.create_gui_data(output_object[0], p_file) 182 182 183 183 # Extract Info elements into a model item -
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
ra95c44b r4fdb727 333 333 self.chk2DView.setVisible(False) 334 334 self.chkMagnetism.setEnabled(self.is2D) 335 self.chkMagnetism.setVisible(self.is2D) 336 self.tabFitting.setTabEnabled(TAB_MAGNETISM, self.is2D) 335 337 # Combo box or label for file name" 336 338 if self.is_batch_fitting:
Note: See TracChangeset
for help on using the changeset viewer.