本文整理匯總了Python中pbsmrtpipe.models.RunnableTask.to_dict方法的典型用法代碼示例。如果您正苦於以下問題:Python RunnableTask.to_dict方法的具體用法?Python RunnableTask.to_dict怎麽用?Python RunnableTask.to_dict使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pbsmrtpipe.models.RunnableTask
的用法示例。
在下文中一共展示了RunnableTask.to_dict方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: write_task_manifest
# 需要導入模塊: from pbsmrtpipe.models import RunnableTask [as 別名]
# 或者: from pbsmrtpipe.models.RunnableTask import to_dict [as 別名]
def write_task_manifest(manifest_path, tid, task, resource_types, task_version, python_mode_str, cluster_renderer):
"""
:type manifest_path: str
:type tid: str
:type task: Task
:type task_version: str
:type python_mode_str: str
:type cluster_renderer: ClusterTemplateRender | None
:return:
"""
# this should be already set in task, or is this for deferred reasons?
resources_list_d = [dict(resource_type=r, path=p) for r, p in zip(resource_types, task.resources)]
task_manifest = os.path.join(manifest_path)
with open(task_manifest, 'w+') as f:
# this version should be the global pbsmrtpipe version
# or the manifest file spec version?
runnable_task = RunnableTask(task, cluster_renderer)
f.write(json.dumps(runnable_task.to_dict(), sort_keys=True, indent=2))
log.debug("wrote task id {i} to {p}".format(i=tid, p=manifest_path))
return True