示例#1
0
文件: test-GDL.py 项目: pjb7687/gdl
def test_function_user():
    '''Call the sinus function via a user defined function'''

    code = '''
    function MYSIN, arg
      return, sin(arg)
    end
    '''
    with GDLFile(code) as name:
        assert GDL.function(name, 1.0) == math.sin(1.0)
示例#2
0
文件: test-GDL.py 项目: pjb7687/gdl
def test_function_arg_pass_return(arg):
    '''Call a function that just returns its argument, with different data types'''

    code = '''
    function ARG_PASS_RETURN, arg
      return, arg
    end
    '''
    with GDLFile(code) as name:
        assert numpy.all(GDL.function(name, arg) == arg)
示例#3
0
文件: test_GDL.py 项目: cenit/GDL
def test_function_arg_pass_return(arg):
    '''Call a function that just returns its argument, with different data types'''

    code = '''
    function ARG_PASS_RETURN, arg
      return, arg
    end
    '''
    with GDLFile(code) as name:
        assert numpy.all(GDL.function(name, arg) == arg)
示例#4
0
文件: test_GDL.py 项目: cenit/GDL
def test_function_user():
    '''Call the sinus function via a user defined function'''

    code = '''
    function MYSIN, arg
      return, sin(arg)
    end
    '''
    with GDLFile(code) as name:
        assert GDL.function(name, 1.0) == math.sin(1.0)
示例#5
0
文件: test-GDL.py 项目: pjb7687/gdl
def test_function_internal():
    '''Call the internal sin() function'''

    assert GDL.function('sin', 1.0) == math.sin(1.0)
示例#6
0
文件: test_GDL.py 项目: cenit/GDL
def test_function_internal():
    '''Call the internal sin() function'''
    
    assert GDL.function('sin', 1.0) == math.sin(1.0)