コード例 #1
0
ファイル: actions_python.py プロジェクト: pgcudahy/sos
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)
コード例 #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)
コード例 #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)
コード例 #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)
コード例 #5
0
ファイル: actions_matlab.py プロジェクト: pgcudahy/sos
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)
コード例 #6
0
ファイル: actions_matlab.py プロジェクト: pythseq/SoS
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)
コード例 #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)
コード例 #8
0
ファイル: actions_ruby.py プロジェクト: pgcudahy/sos
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)
コード例 #9
0
ファイル: actions_bash.py プロジェクト: yzhao2020/sos
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)
コード例 #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)