本文整理汇总了Python中fireworks.LaunchPad.reset方法的典型用法代码示例。如果您正苦于以下问题:Python LaunchPad.reset方法的具体用法?Python LaunchPad.reset怎么用?Python LaunchPad.reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fireworks.LaunchPad
的用法示例。
在下文中一共展示了LaunchPad.reset方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: lp
# 需要导入模块: from fireworks import LaunchPad [as 别名]
# 或者: from fireworks.LaunchPad import reset [as 别名]
def lp(request):
lp = LaunchPad(name=TESTDB_NAME, strm_lvl='ERROR')
lp.reset(password=None, require_password=False)
def fin():
lp.connection.drop_database(TESTDB_NAME)
request.addfinalizer(fin)
return lp
示例2: main
# 需要导入模块: from fireworks import LaunchPad [as 别名]
# 或者: from fireworks.LaunchPad import reset [as 别名]
def main():
# set up the LaunchPad and reset it
launchpad = LaunchPad()
launchpad.reset('', require_password=False)
# Build the flow
nflows = 2
for i in range(nflows):
flow = build_flow("flow_" + str(i))
flow.build_and_pickle_dump()
# create the Firework consisting of a single task
firework = Firework(FireTaskWithFlow(flow=flow))
# store workflow
launchpad.add_wf(firework)
#launch it locally
#launch_rocket(launchpad)
return 0
示例3: LaunchPad
# 需要导入模块: from fireworks import LaunchPad [as 别名]
# 或者: from fireworks.LaunchPad import reset [as 别名]
from fireworks import Firework, Workflow, LaunchPad, ScriptTask
from fireworks.core.rocket_launcher import rapidfire
# set up the LaunchPad and reset it
launchpad = LaunchPad()
launchpad.reset('', require_password=False)
# create the individual FireWorks and Workflow
fw1 = Firework(ScriptTask.from_str('echo "hello"'), name="hello")
fw2 = Firework(ScriptTask.from_str('echo "goodbye"'), name="goodbye", parents=[fw1,])
wf = Workflow([fw1, fw2], name="test workflow")
# store workflow and launch it locally
launchpad.add_wf(wf)
rapidfire(launchpad)
示例4: FireWork
# 需要导入模块: from fireworks import LaunchPad [as 别名]
# 或者: from fireworks.LaunchPad import reset [as 别名]
Returns:
(Workflow): A workflow containing one FireWork (two FireTasks) which
is automatically set up to run the optimization loop.
"""
spec = {'_x': x}
# ObjectiveFuncTask writes _y field to the spec internally.
firework1 = Firework([ObjectiveFuncTask(), OptTask(**db_info)], spec=spec)
return Workflow([firework1])
if __name__ == "__main__":
# Make a MissionControl object
mc = MissionControl(**db_info)
# Reset the launchpad and optimization db for this example
launchpad.reset(password=None, require_password=False)
mc.reset(hard=True)
# Configure the optimization db with MissionControl
mc.configure(wf_creator=wf_creator, dimensions=x_dim)
# Run the optimization loop 10 times.
launchpad.add_wf(wf_creator([5, 5, 2]))
rapidfire(launchpad, nlaunches=10, sleep_time=0)
# Examine results
plt = mc.plot()
plt.show()