コード例 #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)