Changeset 7485cfa in sasview


Ignore:
Timestamp:
Jan 18, 2012 9:51:45 AM (12 years ago)
Author:
Jae Cho <jhjcho@…>
Branches:
master, 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, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
f505470
Parents:
530cc84
Message:

custom run 1d use y=0 if y is supplied

File:
1 edited

Legend:

Unmodified
Added
Removed
  • calculatorview/src/sans/perspectives/calculator/model_editor.py

    r530cc84 r7485cfa  
    618618        #function here 
    619619""" 
    620 TEST_TEMPLATE = """ 
    621 ###################################################################### 
    622 ## THIS IS FOR TEST. DO NOT MODIFY THE FOLLOWING LINES!!!!!!!!!!!!!!!!        
    623 if __name__ == "__main__":  
    624     m= Model()  
    625     out1 = m.runXY(0.0) 
    626     out2 = m.runXY(0.01) 
    627     isfine1 = numpy.isfinite(out1) 
    628     isfine2 = numpy.isfinite(out2) 
    629     print "Testing the value at Q = 0.0:" 
    630     print out1, " : finite? ", isfine1 
    631     print "Testing the value at Q = 0.01:" 
    632     print out2, " : finite? ", isfine2 
    633     if isfine1 and isfine2: 
    634         print "===> Simple Test: Passed!" 
    635     else: 
    636         print "===> Simple Test: Failed!" 
    637 """     
    638620CUSTOM_2D_TEMP = """ 
    639621    def run(self, x=0.0): 
     
    646628            raise ValueError, msg 
    647629        else: 
    648             return self.function(x, x) 
     630            return self.function(x, 0.0) 
    649631    def runXY(self, x=0.0, y=0.0): 
    650632        if x.__class__.__name__ == 'list': 
     
    671653            iq_array = v_model(qdist) 
    672654            return iq_array 
     655""" 
     656TEST_TEMPLATE = """ 
     657###################################################################### 
     658## THIS IS FOR TEST. DO NOT MODIFY THE FOLLOWING LINES!!!!!!!!!!!!!!!!        
     659if __name__ == "__main__":  
     660    m= Model()  
     661    out1 = m.runXY(0.0) 
     662    out2 = m.runXY(0.01) 
     663    isfine1 = numpy.isfinite(out1) 
     664    isfine2 = numpy.isfinite(out2) 
     665    print "Testing the value at Q = 0.0:" 
     666    print out1, " : finite? ", isfine1 
     667    print "Testing the value at Q = 0.01:" 
     668    print out2, " : finite? ", isfine2 
     669    if isfine1 and isfine2: 
     670        print "===> Simple Test: Passed!" 
     671    else: 
     672        print "===> Simple Test: Failed!" 
    673673""" 
    674674SUM_TEMPLATE = """ 
     
    969969    dir_path = models.find_plugins_dir() 
    970970    app  = wx.App() 
    971     window = EditorWindow(parent=None, base=None, path=dir_path, title="AAA") 
     971    window = EditorWindow(parent=None, base=None, path=dir_path, title="Editor") 
    972972    app.MainLoop()          
Note: See TracChangeset for help on using the changeset viewer.