How to use the anypytools.AnyPyProcess 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 / anypytools / pytest_plugin.py View on Github external
def runtest(self):
        """Run an AnyScript test item."""

        tmpdir = Path(
            TempdirFactory(TempPathFactory.from_config(self.config)).mktemp(self.name)
        )

        with change_dir(tmpdir):
            self.app = AnyPyProcess(**self.app_opts)
            result = self.app.start_macro(self.macro)[0]

        # Ignore error due to missing Main.RunTest
        if "ERROR" in result:
            runtest_missing = any(
                "Error : Main.RunTest :" in err for err in result["ERROR"]
            )
            if runtest_missing:
                runtest_errros = (
                    "Error : Main.RunTest : Unresolved",
                    "Main.RunTest : Select Operation",
                    "Error : run : command unexpected while",
                )
                result["ERROR"][:] = [
                    err
                    for err in result["ERROR"]
github AnyBody-Research-Group / AnyPyTools / tests / test_hdf5.py View on Github external
app.start_macro(default_macro)
    
    app.save_to_hdf5('test.hdf5', 'LungeTLEM1')        
        
    assert(os.path.exists('test.hdf5'))
    
    
    
if __name__ == '__main__':
    macro = [['load "Demo.Arm2D.any"',
              'operation Main.ArmModelStudy.InverseDynamics',
              'run',
              'classoperation Main.ArmModelStudy.Output.MaxMuscleActivity "Dump"',
              'classoperation Main.ArmModel.GlobalRef.t "Dump"'
              ]]*5
    app = AnyPyProcess(keep_logfiles=True)
    app.start_macro(macro)
    
    app.save_to_hdf5('test2.hdf5', 'Lunge11dec')
github AnyBody-Research-Group / AnyPyTools / tests / test_hdf5.py View on Github external
def test_hdf5save(tmpdir, default_macro):
    setup_simple_model( tmpdir )
    tmpdir.chdir()
    app = AnyPyProcess(keep_logfiles=True)
    app.start_macro(default_macro)
    
    app.save_to_hdf5('test.hdf5', 'LungeTLEM1')        
        
    assert(os.path.exists('test.hdf5'))
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" )