Changeset 93c79b5 in sasview for src/sas/qtgui/Utilities


Ignore:
Timestamp:
Apr 25, 2018 6:08:35 AM (7 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
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:
d4dac80
Parents:
27689dc (diff), 38f838e (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.
Message:

Merge branch 'ESS_GUI' into ESS_GUI_sum_editor

Location:
src/sas/qtgui/Utilities
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Utilities/TabbedModelEditor.py

    r3b8cc00 r93c79b5  
    126126        self.editor_widget.setEnabled(True) 
    127127        self.editor_widget.blockSignals(False) 
    128         self.filename, _ = os.path.splitext(os.path.basename(filename)) 
    129  
    130         self.setWindowTitle(self.window_title + " - " + self.filename) 
     128        self.filename = filename 
     129        display_name, _ = os.path.splitext(os.path.basename(filename)) 
     130 
     131        self.setWindowTitle(self.window_title + " - " + display_name) 
    131132 
    132133    def onModifiedExit(self): 
  • src/sas/qtgui/Utilities/GuiUtils.py

    rbb57068 r27689dc  
    1010import webbrowser 
    1111import urllib.parse 
     12 
     13import numpy as np 
    1214 
    1315warnings.simplefilter("ignore") 
     
    926928        input = input.replace(",", "") 
    927929 
     930def 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 
    928957 
    929958def enum(*sequential, **named): 
  • src/sas/qtgui/Utilities/PluginDefinition.py

    r8b480d27 r3b8cc00  
    5858 
    5959        # Validators 
    60         #rx = QtCore.QRegExp(r'^[\w,\s-]+$') 
    61         #rx = QtCore.QRegExp("[a-z-A-Z_]+") 
    6260        rx = QtCore.QRegExp("^[A-Za-z0-9_]*$") 
    6361 
  • src/sas/qtgui/Utilities/PluginManager.py

    r8b480d27 r3b8cc00  
    1919    """ 
    2020    def __init__(self, parent=None): 
    21         super(PluginManager, self).__init__() 
     21        super(PluginManager, self).__init__(parent._parent) 
    2222        self.setupUi(self) 
    2323 
Note: See TracChangeset for help on using the changeset viewer.