Changes in / [38f838e:93c79b5] in sasview
- Location:
- src/sas/qtgui
- Files:
-
- 3 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/GUITests.py
r3b3b40b r01ef3f7 48 48 from Utilities.UnitTesting import PluginDefinitionTest 49 49 from Utilities.UnitTesting import TabbedModelEditorTest 50 from Utilities.UnitTesting import AddMultEditorTest 50 51 51 52 # Unit Testing … … 107 108 unittest.makeSuite(PluginDefinitionTest.PluginDefinitionTest, 'test'), 108 109 unittest.makeSuite(TabbedModelEditorTest.TabbedModelEditorTest,'test'), 110 unittest.makeSuite(AddMultEditorTest.AddMultEditorTest, 'test'), 109 111 110 112 # Calculators -
src/sas/qtgui/MainWindow/GuiManager.py
r8ac3551 r3b8cc00 39 39 from sas.qtgui.Perspectives.Fitting.FittingPerspective import FittingWindow 40 40 from sas.qtgui.MainWindow.DataExplorer import DataExplorerWindow, DEFAULT_PERSPECTIVE 41 42 from sas.qtgui.Utilities.AddMultEditor import AddMultEditor 41 43 42 44 class Acknowledgements(QDialog, Ui_Acknowledgements): … … 407 409 self._workspace.actionEdit_Custom_Model.triggered.connect(self.actionEdit_Custom_Model) 408 410 self._workspace.actionManage_Custom_Models.triggered.connect(self.actionManage_Custom_Models) 411 self._workspace.actionAddMult_Models.triggered.connect(self.actionAddMult_Models) 409 412 # Window 410 413 self._workspace.actionCascade.triggered.connect(self.actionCascade) … … 681 684 self.model_manager.show() 682 685 686 def actionAddMult_Models(self): 687 """ 688 """ 689 # Add Simple Add/Multiply Editor 690 self.add_mult_editor = AddMultEditor(self) 691 self.add_mult_editor.show() 692 683 693 #============ ANALYSIS ================= 684 694 def actionFitting(self): -
src/sas/qtgui/MainWindow/UI/MainWindowUI.ui
r8ac3551 r01ef3f7 25 25 <y>0</y> 26 26 <width>915</width> 27 <height>2 6</height>27 <height>22</height> 28 28 </rect> 29 29 </property> … … 111 111 <addaction name="actionEdit_Custom_Model"/> 112 112 <addaction name="actionManage_Custom_Models"/> 113 <addaction name="actionAddMult_Models"/> 113 114 </widget> 114 115 <widget class="QMenu" name="menuWindow"> … … 526 527 </property> 527 528 </action> 529 <action name="actionAddMult_Models"> 530 <property name="text"> 531 <string>Add/Multiply Models</string> 532 </property> 533 </action> 528 534 </widget> 529 535 <resources/> -
src/sas/qtgui/Utilities/GuiUtils.py
rbb57068 r27689dc 10 10 import webbrowser 11 11 import urllib.parse 12 13 import numpy as np 12 14 13 15 warnings.simplefilter("ignore") … … 926 928 input = input.replace(",", "") 927 929 930 def checkModel(path): 931 """ 932 Check that the model save in file 'path' can run. 933 """ 934 # The following return needs to be removed once 935 # the unittest related changes in Sasmodels are commited 936 return True 937 # try running the model 938 from sasmodels.sasview_model import load_custom_model 939 Model = load_custom_model(path) 940 model = Model() 941 q = np.array([0.01, 0.1]) 942 _ = model.evalDistribution(q) 943 qx, qy = np.array([0.01, 0.01]), np.array([0.1, 0.1]) 944 _ = model.evalDistribution([qx, qy]) 945 946 # check the model's unit tests run 947 from sasmodels.model_test import run_one 948 # TestSuite module in Qt5 now deletes tests in the suite after running, 949 # so suite[0] in run_one() in sasmodels/model_test.py will contain [None] and 950 # test.info.tests will raise. 951 # Not sure how to change the behaviour here, most likely sasmodels will have to 952 # be modified 953 result = run_one(path) 954 955 return result 956 928 957 929 958 def enum(*sequential, **named): -
src/sas/qtgui/Utilities/PluginDefinition.py
r8b480d27 r3b8cc00 58 58 59 59 # Validators 60 #rx = QtCore.QRegExp(r'^[\w,\s-]+$')61 #rx = QtCore.QRegExp("[a-z-A-Z_]+")62 60 rx = QtCore.QRegExp("^[A-Za-z0-9_]*$") 63 61 -
src/sas/qtgui/Utilities/PluginManager.py
r8b480d27 r3b8cc00 19 19 """ 20 20 def __init__(self, parent=None): 21 super(PluginManager, self).__init__( )21 super(PluginManager, self).__init__(parent._parent) 22 22 self.setupUi(self) 23 23 -
src/sas/qtgui/Utilities/TabbedModelEditor.py
r38f838e r3b8cc00 11 11 from sas.sascalc.fit import models 12 12 13 import sas.qtgui.Utilities.GuiUtils as GuiUtils 13 14 from sas.qtgui.Utilities.UI.TabbedModelEditor import Ui_TabbedModelEditor 14 15 from sas.qtgui.Utilities.PluginDefinition import PluginDefinition … … 23 24 # Signals for intertab communication plugin -> editor 24 25 def __init__(self, parent=None, edit_only=False): 25 super(TabbedModelEditor, self).__init__( )26 super(TabbedModelEditor, self).__init__(parent._parent) 26 27 27 28 self.parent = parent … … 239 240 # Run the model test in sasmodels 240 241 try: 241 _ = self.checkModel(full_path)242 _ = GuiUtils.checkModel(full_path) 242 243 except Exception as ex: 243 244 msg = "Error building model: "+ str(ex) … … 406 407 407 408 @classmethod 408 def checkModel(cls, path):409 """410 Check that the model save in file 'path' can run.411 """412 # try running the model413 from sasmodels.sasview_model import load_custom_model414 Model = load_custom_model(path)415 model = Model()416 q = np.array([0.01, 0.1])417 _ = model.evalDistribution(q)418 qx, qy = np.array([0.01, 0.01]), np.array([0.1, 0.1])419 _ = model.evalDistribution([qx, qy])420 421 # check the model's unit tests run422 from sasmodels.model_test import run_one423 # TestSuite module in Qt5 now deletes tests in the suite after running,424 # so suite[0] in run_one() in sasmodels/model_test.py will contain [None] and425 # test.info.tests will raise.426 # Not sure how to change the behaviour here, most likely sasmodels will have to427 # be modified428 result = run_one(path)429 430 return result431 432 @classmethod433 409 def getParamHelper(cls, param_str): 434 410 """
Note: See TracChangeset
for help on using the changeset viewer.