How to use the anypytools.macro_commands.SetValue function in anypytools

To help you get started, we’ve selected a few anypytools examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AnyBody-Research-Group / AnyPyTools / tests / test_macros.py View on Github external
def test_setvalue():
    c = mc.SetValue('val', 23.1)
    assert c.get_macro(0)  == 'classoperation val "Set Value" --value="23.1"'

    c = mc.SetValue('val', -0.123010929395)
    assert c.get_macro(0)  == 'classoperation val "Set Value" --value="-0.123010929395"'

    c = mc.SetValue('val', "hallo world")
    assert c.get_macro(0)  == 'classoperation val "Set Value" --value="hallo world"'

    c = mc.SetValue('val', [3.0,4,5.1])
    assert c.get_macro(0)  == 'classoperation val "Set Value" --value="3"'
    assert c.get_macro(1)  == 'classoperation val "Set Value" --value="4"'
    assert c.get_macro(2)  == 'classoperation val "Set Value" --value="5.1"'
    assert c.get_macro(3)  == 'classoperation val "Set Value" --value="3"'


    c = mc.SetValue('val', np.array([1,2,3,4]))
    assert c.get_macro(0)  == 'classoperation val "Set Value" --value="{1,2,3,4}"'
    
    c = mc.SetValue('val', np.array([[1,0],[0,1]]) )
github AnyBody-Research-Group / AnyPyTools / tests / test_macros.py View on Github external
def test_setvalue():
    c = mc.SetValue('val', 23.1)
    assert c.get_macro(0)  == 'classoperation val "Set Value" --value="23.1"'

    c = mc.SetValue('val', -0.123010929395)
    assert c.get_macro(0)  == 'classoperation val "Set Value" --value="-0.123010929395"'

    c = mc.SetValue('val', "hallo world")
    assert c.get_macro(0)  == 'classoperation val "Set Value" --value="hallo world"'

    c = mc.SetValue('val', [3.0,4,5.1])
    assert c.get_macro(0)  == 'classoperation val "Set Value" --value="3"'
    assert c.get_macro(1)  == 'classoperation val "Set Value" --value="4"'
    assert c.get_macro(2)  == 'classoperation val "Set Value" --value="5.1"'
    assert c.get_macro(3)  == 'classoperation val "Set Value" --value="3"'


    c = mc.SetValue('val', np.array([1,2,3,4]))
github AnyBody-Research-Group / AnyPyTools / tests / test_macros.py View on Github external
assert c.get_macro(0)  == 'classoperation val "Set Value" --value="-0.123010929395"'

    c = mc.SetValue('val', "hallo world")
    assert c.get_macro(0)  == 'classoperation val "Set Value" --value="hallo world"'

    c = mc.SetValue('val', [3.0,4,5.1])
    assert c.get_macro(0)  == 'classoperation val "Set Value" --value="3"'
    assert c.get_macro(1)  == 'classoperation val "Set Value" --value="4"'
    assert c.get_macro(2)  == 'classoperation val "Set Value" --value="5.1"'
    assert c.get_macro(3)  == 'classoperation val "Set Value" --value="3"'


    c = mc.SetValue('val', np.array([1,2,3,4]))
    assert c.get_macro(0)  == 'classoperation val "Set Value" --value="{1,2,3,4}"'
    
    c = mc.SetValue('val', np.array([[1,0],[0,1]]) )
    assert c.get_macro(0)  == 'classoperation val "Set Value" --value="{{1,0},{0,1}}"'
github AnyBody-Research-Group / AnyPyTools / tests / test_macros.py View on Github external
def test_setvalue():
    c = mc.SetValue('val', 23.1)
    assert c.get_macro(0)  == 'classoperation val "Set Value" --value="23.1"'

    c = mc.SetValue('val', -0.123010929395)
    assert c.get_macro(0)  == 'classoperation val "Set Value" --value="-0.123010929395"'

    c = mc.SetValue('val', "hallo world")
    assert c.get_macro(0)  == 'classoperation val "Set Value" --value="hallo world"'

    c = mc.SetValue('val', [3.0,4,5.1])
    assert c.get_macro(0)  == 'classoperation val "Set Value" --value="3"'
    assert c.get_macro(1)  == 'classoperation val "Set Value" --value="4"'
    assert c.get_macro(2)  == 'classoperation val "Set Value" --value="5.1"'
    assert c.get_macro(3)  == 'classoperation val "Set Value" --value="3"'


    c = mc.SetValue('val', np.array([1,2,3,4]))
    assert c.get_macro(0)  == 'classoperation val "Set Value" --value="{1,2,3,4}"'
    
    c = mc.SetValue('val', np.array([[1,0],[0,1]]) )
    assert c.get_macro(0)  == 'classoperation val "Set Value" --value="{{1,0},{0,1}}"'
github AnyBody-Research-Group / AnyPyTools / tests / test_macros.py View on Github external
assert c.get_macro(0)  == 'classoperation val "Set Value" --value="23.1"'

    c = mc.SetValue('val', -0.123010929395)
    assert c.get_macro(0)  == 'classoperation val "Set Value" --value="-0.123010929395"'

    c = mc.SetValue('val', "hallo world")
    assert c.get_macro(0)  == 'classoperation val "Set Value" --value="hallo world"'

    c = mc.SetValue('val', [3.0,4,5.1])
    assert c.get_macro(0)  == 'classoperation val "Set Value" --value="3"'
    assert c.get_macro(1)  == 'classoperation val "Set Value" --value="4"'
    assert c.get_macro(2)  == 'classoperation val "Set Value" --value="5.1"'
    assert c.get_macro(3)  == 'classoperation val "Set Value" --value="3"'


    c = mc.SetValue('val', np.array([1,2,3,4]))
    assert c.get_macro(0)  == 'classoperation val "Set Value" --value="{1,2,3,4}"'
    
    c = mc.SetValue('val', np.array([[1,0],[0,1]]) )
    assert c.get_macro(0)  == 'classoperation val "Set Value" --value="{{1,0},{0,1}}"'