Changeset 605d944 in sasview
- Timestamp:
- Sep 6, 2018 5:11:49 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- c0de493
- Parents:
- fd7ef36
- git-author:
- Piotr Rozyczko <rozyczko@…> (09/06/18 05:10:43)
- git-committer:
- Piotr Rozyczko <rozyczko@…> (09/06/18 05:11:49)
- Location:
- src/sas/qtgui/Perspectives/Fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
rfd7ef36 r605d944 968 968 self.has_poly_error_column = False 969 969 970 self.respondToModelStructure(model=model, structure_factor=None) 970 structure = None 971 if self.cbStructureFactor.isEnabled(): 972 structure = str(self.cbStructureFactor.currentText()) 973 self.respondToModelStructure(model=model, structure_factor=structure) 971 974 972 975 def onSelectBatchFilename(self, data_index): … … 1962 1965 # Allow the SF combobox visibility for the given sasmodel 1963 1966 self.enableStructureFactorControl(structure_factor) 1967 if self.cbStructureFactor.isEnabled(): 1968 structure_factor = self.cbStructureFactor.currentText() 1969 self.fromStructureFactorToQModel(structure_factor) 1964 1970 1965 1971 # Then, add multishells … … 2056 2062 Setting model parameters into QStandardItemModel based on selected _structure factor_ 2057 2063 """ 2064 if structure_factor is None or structure_factor=="None": 2065 return 2058 2066 structure_module = generate.load_kernel_module(structure_factor) 2059 2067 structure_parameters = modelinfo.make_parameter_table(getattr(structure_module, 'parameters', [])) -
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingWidgetTest.py
rb764ae5 r605d944 262 262 self.widget.cbModel.setCurrentIndex(0) 263 263 264 # Observe factor reset to None265 self.assertEqual(self.widget.cbStructureFactor.currentText(), STRUCTURE_DEFAULT)264 # Observe factor doesn't reset to None 265 self.assertEqual(self.widget.cbStructureFactor.currentText(), 'squarewell') 266 266 267 267 # Switch category to structure factor … … 639 639 self.assertEqual(spy.count(), 0) 640 640 641 def notestPlotData(self):641 def testPlotData(self): 642 642 """ 643 643 See that data item can produce a chart … … 649 649 # Set data 650 650 test_data = Data1D(x=[1,2], y=[1,2]) 651 651 item = QtGui.QStandardItem() 652 updateModelItem(item, test_data, "test") 652 653 # Force same data into logic 653 self.widget.logic.data = test_data 654 self.widget.data_is_loaded = True 654 self.widget.data = item 655 655 656 656 # Change the category index so we have a model available … … 674 674 self.assertEqual(spy.count(), 1) 675 675 676 def notestOnEmptyFit(self):676 def testOnEmptyFit(self): 677 677 """ 678 678 Test a 1D/2D fit with no parameters … … 687 687 self.widget.cbCategory.setCurrentIndex(category_index) 688 688 689 #self.widget.show()689 self.widget.show() 690 690 691 691 # Test no fitting params … … 698 698 self.widget.close() 699 699 700 def testOnEmptyFit2(self): 700 701 test_data = Data2D(image=[1.0, 2.0, 3.0], 701 702 err_image=[0.01, 0.02, 0.03], … … 708 709 item = QtGui.QStandardItem() 709 710 updateModelItem(item, test_data, "test") 711 710 712 # Force same data into logic 711 713 self.widget.data = item … … 723 725 self.assertTrue(logging.error.called_once()) 724 726 self.assertTrue(logging.error.called_with('no fitting parameters')) 725 #self.widget.close() 726 727 self.widget.close() 727 728 728 729 def notestOnFit1D(self): … … 853 854 self.assertIn("magnetism.html", self.widget.parent.showHelp.call_args[0][0]) 854 855 855 def notestReadFitPage(self):856 def testReadFitPage(self): 856 857 """ 857 858 Read in the fitpage object and restore state … … 859 860 # Set data 860 861 test_data = Data1D(x=[1,2], y=[1,2]) 861 862 item = QtGui.QStandardItem() 863 updateModelItem(item, test_data, "test") 862 864 # Force same data into logic 863 self.widget.logic.data = test_data 864 self.widget.data_is_loaded = True 865 self.widget.data = item 866 867 # Force same data into logic 865 868 category_index = self.widget.cbCategory.findText('Sphere') 869 866 870 self.widget.cbCategory.setCurrentIndex(category_index) 867 871 self.widget.main_params_to_fit = ['scale'] … … 939 943 self.assertTrue(self.widget.tabFitting.isTabEnabled(4)) 940 944 941 def notestCurrentState(self):945 def testCurrentState(self): 942 946 """ 943 947 Set up the fitpage with current state … … 945 949 # Set data 946 950 test_data = Data1D(x=[1,2], y=[1,2]) 947 951 item = QtGui.QStandardItem() 952 updateModelItem(item, test_data, "test") 948 953 # Force same data into logic 949 self.widget.logic.data = test_data 950 self.widget.data_is_loaded = True 954 self.widget.data = item 951 955 category_index = self.widget.cbCategory.findText("Sphere") 952 956 self.widget.cbCategory.setCurrentIndex(category_index) … … 964 968 self.assertListEqual(fp.main_params_to_fit, ['scale']) 965 969 966 def notestPushFitPage(self):970 def testPushFitPage(self): 967 971 """ 968 972 Push current state of fitpage onto stack … … 970 974 # Set data 971 975 test_data = Data1D(x=[1,2], y=[1,2]) 972 976 item = QtGui.QStandardItem() 977 updateModelItem(item, test_data, "test") 973 978 # Force same data into logic 974 self.widget.logic.data = test_data 975 self.widget.data_is_loaded = True 979 self.widget.data = item 976 980 category_index = self.widget.cbCategory.findText("Sphere") 977 981
Note: See TracChangeset
for help on using the changeset viewer.