本文整理汇总了Python中conductor.native.lib.sequence.Sequence.permutations方法的典型用法代码示例。如果您正苦于以下问题:Python Sequence.permutations方法的具体用法?Python Sequence.permutations怎么用?Python Sequence.permutations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类conductor.native.lib.sequence.Sequence
的用法示例。
在下文中一共展示了Sequence.permutations方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_one_substitution
# 需要导入模块: from conductor.native.lib.sequence import Sequence [as 别名]
# 或者: from conductor.native.lib.sequence.Sequence import permutations [as 别名]
def test_one_substitution(self):
template = "image.%(frame)04d.tif"
result = list(Sequence.permutations(template, frame="0-20x2"))
self.assertIn("image.0008.tif", result)
self.assertIn("image.0012.tif", result)
self.assertEqual(len(result), 11)
示例2: test_two_the_same_substitution
# 需要导入模块: from conductor.native.lib.sequence import Sequence [as 别名]
# 或者: from conductor.native.lib.sequence.Sequence import permutations [as 别名]
def test_two_the_same_substitution(self):
template = "/path/%(frame)d/image.%(frame)04d.tif"
result = list(Sequence.permutations(template, frame="0-20x2"))
self.assertIn("/path/8/image.0008.tif", result)
self.assertIn("/path/12/image.0012.tif", result)
self.assertEqual(len(result), 11)
示例3: initialize
# 需要导入模块: from conductor.native.lib.sequence import Sequence [as 别名]
# 或者: from conductor.native.lib.sequence.Sequence import permutations [as 别名]
def initialize(data):
"""Generate list of files from fixture data."""
global FILES
for item in data["files"]:
if item.get("params"):
for fn in Sequence.permutations(item["path"], **item["params"]):
FILES.append(fn)
else:
FILES.append(item["path"])
FILES = sorted(set(FILES))
示例4: test_three_substitutions
# 需要导入模块: from conductor.native.lib.sequence import Sequence [as 别名]
# 或者: from conductor.native.lib.sequence.Sequence import permutations [as 别名]
def test_three_substitutions(self):
template = "image_%(uval)02d_%(vval)02d.%(frame)04d.tif"
kw = {
"uval": "1-2",
"vval": "1-2",
"frame": "10-11"
}
result = list(Sequence.permutations(template, **kw))
self.assertIn("image_01_01.0010.tif", result)
self.assertIn("image_02_02.0011.tif", result)
self.assertIn("image_02_01.0010.tif", result)
self.assertEqual(len(result), 8)