當前位置: 首頁>>代碼示例>>Python>>正文


Python RunnableTask.from_manifest_json方法代碼示例

本文整理匯總了Python中pbsmrtpipe.models.RunnableTask.from_manifest_json方法的典型用法代碼示例。如果您正苦於以下問題:Python RunnableTask.from_manifest_json方法的具體用法?Python RunnableTask.from_manifest_json怎麽用?Python RunnableTask.from_manifest_json使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pbsmrtpipe.models.RunnableTask的用法示例。


在下文中一共展示了RunnableTask.from_manifest_json方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: run_task_manifest_on_cluster

# 需要導入模塊: from pbsmrtpipe.models import RunnableTask [as 別名]
# 或者: from pbsmrtpipe.models.RunnableTask import from_manifest_json [as 別名]
def run_task_manifest_on_cluster(path):
    """
    Run the Task on the queue (of possible)

    :param path:
    :return:
    """
    output_dir = os.path.dirname(path)
    os.chdir(output_dir)
    rt = RunnableTask.from_manifest_json(path)

    # this needs to be updated to have explicit paths to stderr, stdout
    rcode, err_msg, run_time = run_task_on_cluster(rt, path, output_dir, True)
    cstderr = os.path.join(output_dir, "cluster.stderr")
    stderr = os.path.join(output_dir, "stderr")

    state = TaskStates.SUCCESSFUL if rcode == 0 else TaskStates.FAILED
    # Need to update the run_task_on_cluster
    emsg = ""
    if rcode != 0:
        # try to provide a hint of the exception from the stderr
        detail_msg = _extract_last_nlines(stderr)
        cdetails_msg = _extract_last_nlines(cstderr)
        emsg = "{i} Failed with exit code {r} {c}\n{x}".format(r=rcode, i=rt.task.task_id, x=detail_msg, c=cdetails_msg)

    return state, err_msg, run_time
開發者ID:natechols,項目名稱:pbsmrtpipe,代碼行數:28,代碼來源:runner.py

示例2: _args_run_task_manifest

# 需要導入模塊: from pbsmrtpipe.models import RunnableTask [as 別名]
# 或者: from pbsmrtpipe.models.RunnableTask import from_manifest_json [as 別名]
def _args_run_task_manifest(args):
    output_dir = os.getcwd() if args.output_dir is None else args.output_dir
    task_manifest_path = args.task_manifest

    rt = RunnableTask.from_manifest_json(task_manifest_path)

    rcode, _ = run_task(rt, output_dir, args.task_stdout, args.task_stderr, args.debug)

    return rcode
開發者ID:skinner,項目名稱:pbsmrtpipe,代碼行數:11,代碼來源:runner.py

示例3: _args_run_task_manifest

# 需要導入模塊: from pbsmrtpipe.models import RunnableTask [as 別名]
# 或者: from pbsmrtpipe.models.RunnableTask import from_manifest_json [as 別名]
def _args_run_task_manifest(args):
    output_dir = os.getcwd() if args.output_dir is None else args.output_dir
    task_manifest_path = args.task_manifest

    log.info("Loading runnable-task from {f}".format(f=task_manifest_path))
    rt = RunnableTask.from_manifest_json(task_manifest_path)
    log.info("loaded runnable-task")

    # (exit code, run_time_sec) =
    rcode, err_msg, _ = run_task(rt, output_dir, args.task_stdout, args.task_stderr, args.debug)

    return rcode
開發者ID:natechols,項目名稱:pbsmrtpipe,代碼行數:14,代碼來源:runner.py

示例4: run_task_manifest_on_cluster

# 需要導入模塊: from pbsmrtpipe.models import RunnableTask [as 別名]
# 或者: from pbsmrtpipe.models.RunnableTask import from_manifest_json [as 別名]
def run_task_manifest_on_cluster(path):
    """
    Run the Task on the queue (of possible)

    :param path:
    :return:
    """
    output_dir = os.path.dirname(path)
    rt = RunnableTask.from_manifest_json(path)

    rcode, run_time = run_task_on_cluster(rt, path, output_dir, True)

    state = TaskStates.SUCCESSFUL if rcode == 0 else TaskStates.FAILED
    msg = "{r} failed".format(r=rt) if rcode != 0 else ""

    return state, msg, run_time
開發者ID:yqin22,項目名稱:pbsmrtpipe,代碼行數:18,代碼來源:runner.py

示例5: run_task_manifest_on_cluster

# 需要導入模塊: from pbsmrtpipe.models import RunnableTask [as 別名]
# 或者: from pbsmrtpipe.models.RunnableTask import from_manifest_json [as 別名]
def run_task_manifest_on_cluster(path):
    """
    Run the Task on the queue (of possible)

    :param path:
    :return:
    """
    output_dir = os.path.dirname(path)
    os.chdir(output_dir)
    rt = RunnableTask.from_manifest_json(path)

    # this needs to be updated to have explicit paths to stderr, stdout
    rcode, err_msg, run_time = run_task_on_cluster(rt, path, output_dir, True)

    state = TaskStates.from_int(rcode)

    return state, err_msg, run_time
開發者ID:PacificBiosciences,項目名稱:pbsmrtpipe,代碼行數:19,代碼來源:runner.py

示例6: run_task_manifest

# 需要導入模塊: from pbsmrtpipe.models import RunnableTask [as 別名]
# 或者: from pbsmrtpipe.models.RunnableTask import from_manifest_json [as 別名]
def run_task_manifest(path):
    output_dir = os.path.dirname(path)
    stderr = os.path.join(output_dir, 'stderr')
    stdout = os.path.join(output_dir, 'stdout')

    try:
        rt = RunnableTask.from_manifest_json(path)
    except KeyError:
        emsg = "Unable to deserialize RunnableTask from manifest {p}".format(p=path)
        log.error(emsg)
        raise

    rcode, run_time = run_task(rt, output_dir, stdout, stderr, True)

    state = TaskStates.SUCCESSFUL if rcode == 0 else TaskStates.FAILED
    msg = "" if rcode == 0 else "Failed with exit code {r}".format(r=rcode)

    return state, msg, run_time
開發者ID:yqin22,項目名稱:pbsmrtpipe,代碼行數:20,代碼來源:runner.py

示例7: run_task_manifest

# 需要導入模塊: from pbsmrtpipe.models import RunnableTask [as 別名]
# 或者: from pbsmrtpipe.models.RunnableTask import from_manifest_json [as 別名]
def run_task_manifest(path):
    output_dir = os.path.dirname(path)
    os.chdir(output_dir)
    stderr = os.path.join(output_dir, 'stderr')
    stdout = os.path.join(output_dir, 'stdout')

    try:
        rt = RunnableTask.from_manifest_json(path)
    except KeyError:
        emsg = "Unable to deserialize RunnableTask from manifest {p}".format(p=path)
        log.error(emsg)
        raise

    # blocking call
    rcode, err_msg, run_time = run_task(rt, output_dir, stdout, stderr, True)

    state = TaskStates.from_int(rcode)

    return state, err_msg, run_time
開發者ID:PacificBiosciences,項目名稱:pbsmrtpipe,代碼行數:21,代碼來源:runner.py

示例8: run_task_manifest

# 需要導入模塊: from pbsmrtpipe.models import RunnableTask [as 別名]
# 或者: from pbsmrtpipe.models.RunnableTask import from_manifest_json [as 別名]
def run_task_manifest(path):
    output_dir = os.path.dirname(path)
    os.chdir(output_dir)
    stderr = os.path.join(output_dir, 'stderr')
    stdout = os.path.join(output_dir, 'stdout')

    try:
        rt = RunnableTask.from_manifest_json(path)
    except KeyError:
        emsg = "Unable to deserialize RunnableTask from manifest {p}".format(p=path)
        log.error(emsg)
        raise

    rcode, err_msg, run_time = run_task(rt, output_dir, stdout, stderr, True)

    state = TaskStates.SUCCESSFUL if rcode == 0 else TaskStates.FAILED
    emsg = ""
    if rcode != 0:
        # try to provide a hint of the exception from the stderr
        detail_msg = _extract_last_nlines(stderr)
        emsg = "{i} Failed with exit code {r} {x}".format(r=rcode, i=rt.task.task_id, x=detail_msg)

    return state, err_msg, run_time
開發者ID:natechols,項目名稱:pbsmrtpipe,代碼行數:25,代碼來源:runner.py

示例9: _args_pprint_task_manifest

# 需要導入模塊: from pbsmrtpipe.models import RunnableTask [as 別名]
# 或者: from pbsmrtpipe.models.RunnableTask import from_manifest_json [as 別名]
def _args_pprint_task_manifest(args):
    return pprint_task_manifest(RunnableTask.from_manifest_json(args.task_manifest))
開發者ID:skinner,項目名稱:pbsmrtpipe,代碼行數:4,代碼來源:runner.py

示例10: _args_to_cmd

# 需要導入模塊: from pbsmrtpipe.models import RunnableTask [as 別名]
# 或者: from pbsmrtpipe.models.RunnableTask import from_manifest_json [as 別名]
def _args_to_cmd(args):
    return run_to_cmd(RunnableTask.from_manifest_json(args.task_manifest))
開發者ID:skinner,項目名稱:pbsmrtpipe,代碼行數:4,代碼來源:runner.py

示例11: validate_file_and_load_manifest

# 需要導入模塊: from pbsmrtpipe.models import RunnableTask [as 別名]
# 或者: from pbsmrtpipe.models.RunnableTask import from_manifest_json [as 別名]
def validate_file_and_load_manifest(path):
    rt = RunnableTask.from_manifest_json(validate_file(path))
    # if we got here everything is valid
    return path
開發者ID:skinner,項目名稱:pbsmrtpipe,代碼行數:6,代碼來源:runner.py

示例12: test_task_manifest_serialization

# 需要導入模塊: from pbsmrtpipe.models import RunnableTask [as 別名]
# 或者: from pbsmrtpipe.models.RunnableTask import from_manifest_json [as 別名]
 def test_task_manifest_serialization(self):
     path = os.path.join(TEST_DATA_DIR, 'task-manifest.json')
     r = RunnableTask.from_manifest_json(path)
     self.assertIsInstance(r, RunnableTask)
開發者ID:bnbowman,項目名稱:pbsmrtpipe,代碼行數:6,代碼來源:test_pb_tasks_core.py


注:本文中的pbsmrtpipe.models.RunnableTask.from_manifest_json方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。