How to use the anypytools.macro_commands.Load 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_load():
    cmd = mc.Load('main.any', defs =  {'TEST_STR': '"Test\\string"'} )
    assert cmd.get_macro(0) == 'load "main.any" -def TEST_STR=---"\\"Test\\\\string\\""'

    cmd = mc.Load('main.any', defs =  {'TEST_VAR': 'Main.MyStudy'} )
    assert cmd.get_macro(0) == 'load "main.any" -def TEST_VAR="Main.MyStudy"' 

    cmd = mc.Load('main.any', paths = {'TEST_PATH': 'c:\\path\\to\\something' })
    assert cmd.get_macro(0) == 'load "main.any" -p TEST_PATH=---"c:\\\\path\\\\to\\\\something"'
github AnyBody-Research-Group / AnyPyTools / tests / test_macros.py View on Github external
def test_macros():
    mcr = AnyMacro(number_of_macros = 10)
    mcr.append(mc.Load('main.any'))
    
    macros = mcr.create_macros()
    
    assert macros[0][0] == 'load "main.any"'
    assert macros[1][0] == 'load "main.any"'
    assert len(macros) == 10
github AnyBody-Research-Group / AnyPyTools / tests / test_macros.py View on Github external
def test_load():
    cmd = mc.Load('main.any', defs =  {'TEST_STR': '"Test\\string"'} )
    assert cmd.get_macro(0) == 'load "main.any" -def TEST_STR=---"\\"Test\\\\string\\""'

    cmd = mc.Load('main.any', defs =  {'TEST_VAR': 'Main.MyStudy'} )
    assert cmd.get_macro(0) == 'load "main.any" -def TEST_VAR="Main.MyStudy"' 

    cmd = mc.Load('main.any', paths = {'TEST_PATH': 'c:\\path\\to\\something' })
    assert cmd.get_macro(0) == 'load "main.any" -p TEST_PATH=---"c:\\\\path\\\\to\\\\something"'
github AnyBody-Research-Group / AnyPyTools / docs / slides / BatchProcess / batchprocess.py View on Github external
from anypytools import AnyPyProcess
from anypytools.macro_commands import Load, OperationRun

app = AnyPyProcess(num_processes = 3)

macro = [Load("main.any"),
         OperationRun('Main.Study.InverseDynamics') ]
         
app.start_macro(macro, search_subdirs= "model[1-9].*main.any" )