当前位置: 首页>>代码示例>>Python>>正文


Python LaunchPad.add_wf方法代码示例

本文整理汇总了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]))
开发者ID:shyuep,项目名称:fireworks_for_babies,代码行数:17,代码来源:workflows.py

示例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:
开发者ID:yanikou19,项目名称:fireworks,代码行数:32,代码来源:lp_run.py

示例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)
开发者ID:digitalsatori,项目名称:fireworks,代码行数:26,代码来源:dynamic_wf1.py


注:本文中的fireworks.core.launchpad.LaunchPad.add_wf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。