Ejemplo n.º 1
0
def python2(script, args="", **kwargs):
    """Execute specified script using python2, and python if python2 does
    not exist. This action accepts common action arguments such as
    input, active, workdir, docker_image and args. In particular, content of one or more files
    specified by option input would be prepended before the specified script."""
    return SoS_ExecuteScript(script, ["python2", "python2.7", "python"], ".py",
                             args).run(**kwargs)
Ejemplo n.º 2
0
def python3(script, args='', **kwargs):
    '''Execute specified script using python3, and python if python3 does
    not exist. This action accepts common action arguments such as
    input, active, workdir, docker_image and args. In particular, content of one or more files
    specified by option input would be prepended before the specified script.'''
    return SoS_ExecuteScript(script, ['python3', 'python'], '.py',
                             args).run(**kwargs)
Ejemplo n.º 3
0
def julia(script, args="", **kwargs):
    """Execute specified Julia script with command julia. This action accepts common
    action arguments such as input, active, workdir, docker_image and args. In
    particular, content of one or more files  specified by option input would be
    prepended before the specified script.
    """
    return SoS_ExecuteScript(script, "julia", ".jl", args).run(**kwargs)
Ejemplo n.º 4
0
def node(script, args='', **kwargs):
    '''Execute specified script with command node. This action accepts common action arguments
    such as input, active, workdir, docker_image and args. In particular, content of one or
    more files  specified by option input would be prepended before the specified script.
    '''
    return SoS_ExecuteScript(
        script, 'node', '.js', args).run(**kwargs)
Ejemplo n.º 5
0
def octave(script, args="", **kwargs):
    """Execute specified script with command Matlab, with default options
    "-nodisplay -r". This action accepts common action arguments such as input,
    active, workdir, docker_image and args. In particular, content of one or more
    files  specified by option input would be
    prepended before the specified script.
    """
    return SoS_ExecuteScript(script, "octave", ".m", args).run(**kwargs)
Ejemplo n.º 6
0
def matlab(script, args='''-nojvm -nodisplay -nosplash -nodesktop -r "try, run('{filename}'), catch me, fprintf('%s / %s\\n',me.identifier,me.message), exit(1), end, exit(0);"''', **kwargs):
    '''Execute specified script with command Matlab, with default options
    "-nojvm -nodisplay -nosplash -nodesktop -r". This action accepts common action arguments such as input,
    active, workdir, docker_image and args. In particular, content of one or more 
    files  specified by option input would be
    prepended before the specified script.
    '''
    return SoS_ExecuteScript(
        script, 'matlab', '.m', args).run(**kwargs)
Ejemplo n.º 7
0
def R(script, args='', **kwargs):
    '''Execute specified script with command Rscript, with default options
    "--default-packages=datasets,methods,utils,stats,grDevices,graphics". This action accepts
    common action arguments such as input, active, workdir, docker_image and args.
    In particular, content of one or more files  specified by option input would be
    prepended before the specified script.
    '''
    # > getOption('defaultPackages')
    # [1] "datasets"  "utils"     "grDevices" "graphics"  "stats"     "methods"
    return SoS_ExecuteScript(script, 'Rscript', '.R', args).run(**kwargs)
Ejemplo n.º 8
0
def ruby(script, args="", **kwargs):
    """Execute specified script using ruby. This action accepts common action arguments such as
    input, active, workdir, docker_image and args. In particular, content of one or more files
    specified by option input would be prepended before the specified script."""
    return SoS_ExecuteScript(script, "ruby", ".rb", args).run(**kwargs)
Ejemplo n.º 9
0
def bash(script, args='', **kwargs):
    '''Execute specified script using bash. This action accepts common action arguments such as
    input, active, workdir, docker_image and args. In particular, content of one or more files
    specified by option input would be prepended before the specified script.'''
    return SoS_ExecuteScript(script, ['/bin/bash', 'bash'], '.sh',
                             args).run(**kwargs)
Ejemplo n.º 10
0
def python(script, args='', **kwargs):
    '''Execute specified script using python (which can be python 2 or 3 depending on
    system configuration. This action accepts common action arguments such as
    input, active, workdir, docker_image and args. In particular, content of one or more files
    specified by option input would be prepended before the specified script.'''
    return SoS_ExecuteScript(script, 'python', '.py', args).run(**kwargs)