本文整理汇总了Python中fireworks.core.firework.Workflow.remove_fws方法的典型用法代码示例。如果您正苦于以下问题:Python Workflow.remove_fws方法的具体用法?Python Workflow.remove_fws怎么用?Python Workflow.remove_fws使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fireworks.core.firework.Workflow
的用法示例。
在下文中一共展示了Workflow.remove_fws方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_remove_root_fws
# 需要导入模块: from fireworks.core.firework import Workflow [as 别名]
# 或者: from fireworks.core.firework.Workflow import remove_fws [as 别名]
def test_remove_root_fws(self):
fw4 = Firework(Task1(), parents=[self.fw2, self.fw3])
fws = [self.fw1, self.fw2, self.fw3, fw4]
wflow = Workflow(fws)
root_ids = wflow.root_fw_ids
children = []
for i in root_ids:
children.extend(wflow.links[i])
wflow.remove_fws(wflow.root_fw_ids)
self.assertEqual(sorted(wflow.root_fw_ids), sorted(children))
示例2: test_remove_leaf_fws
# 需要导入模块: from fireworks.core.firework import Workflow [as 别名]
# 或者: from fireworks.core.firework.Workflow import remove_fws [as 别名]
def test_remove_leaf_fws(self):
fw4 = Firework(Task1(), parents=[self.fw2, self.fw3])
fws = [self.fw1, self.fw2, self.fw3, fw4]
wflow = Workflow(fws)
leaf_ids = wflow.leaf_fw_ids
parents = []
for i in leaf_ids:
parents.extend(wflow.links.parent_links[i])
wflow.remove_fws(wflow.leaf_fw_ids)
self.assertEqual(wflow.leaf_fw_ids, parents)