本文整理汇总了Python中fireworks.core.launchpad.LaunchPad.add_wf方法的典型用法代码示例。如果您正苦于以下问题:Python LaunchPad.add_wf方法的具体用法?Python LaunchPad.add_wf怎么用?Python LaunchPad.add_wf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fireworks.core.launchpad.LaunchPad
的用法示例。
在下文中一共展示了LaunchPad.add_wf方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: born
# 需要导入模块: from fireworks.core.launchpad import LaunchPad [as 别名]
# 或者: from fireworks.core.launchpad.LaunchPad import add_wf [as 别名]
def born():
fw = Firework(
[
Cry(),
Eat(),
Sleep(),
Poop(),
],
spec={"name": "BabyJain"}
)
launchpad = LaunchPad()
launchpad.add_wf(Workflow([fw]))
示例2:
# 需要导入模块: from fireworks.core.launchpad import LaunchPad [as 别名]
# 或者: from fireworks.core.launchpad.LaunchPad import add_wf [as 别名]
elif args.command == 'detect_fizzled':
# TODO: report when fixed
print lp.detect_fizzled(args.time, args.fix)
elif args.command == 'detect_unreserved':
# TODO: report when fixed
print lp.detect_unreserved(args.time, args.fix)
elif args.command == 'add':
# TODO: make this cleaner, e.g. make TAR option explicit
# fwf = Workflow.from_FireWork(FireWork.from_file(args.wf_file))
# lp.add_wf(fwf)
try:
fwf = Workflow.from_FireWork(FireWork.from_file(args.wf_file))
lp.add_wf(fwf)
except:
try:
if '.tar' in args.wf_file:
fwf = Workflow.from_tarfile(args.wf_file)
else:
fwf = Workflow.from_file(args.wf_file)
lp.add_wf(fwf)
except:
print 'Error reading FireWork/Workflow file.'
traceback.print_exc()
elif args.command == 'get_fw':
fw = lp.get_fw_by_id(args.fw_id)
fw_dict = fw.to_dict()
if args.filename:
示例3: LaunchPad
# 需要导入模块: from fireworks.core.launchpad import LaunchPad [as 别名]
# 或者: from fireworks.core.launchpad.LaunchPad import add_wf [as 别名]
"""
This code is described in the Dynamic Workflow tutorial, https://materialsproject.github.io/fireworks/dynamic_wf_tutorial.html
"""
from fireworks import ScriptTask
from fireworks.core.firework import Firework, Workflow
from fireworks.core.launchpad import LaunchPad
from fireworks.core.rocket_launcher import rapidfire
from fw_tutorials.dynamic_wf.printjob_task import PrintJobTask
if __name__ == "__main__":
# set up the LaunchPad and reset it
launchpad = LaunchPad()
# launchpad.reset('', require_password=False)
# create the Workflow that passes job info
fw1 = Firework([ScriptTask.from_str('echo "This is the first FireWork"')], spec={"_pass_job_info": True}, fw_id=1)
fw2 = Firework([PrintJobTask()], parents=[fw1], fw_id=2)
wf = Workflow([fw1, fw2])
# store workflow and launch it locally
launchpad.add_wf(wf)
rapidfire(launchpad)