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


Python sequence.Sequence类代码示例

本文整理汇总了Python中conductor.native.lib.sequence.Sequence的典型用法代码示例。如果您正苦于以下问题:Python Sequence类的具体用法?Python Sequence怎么用?Python Sequence使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Sequence类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: scout_frame_sequence

def scout_frame_sequence(node):
    """Generate Sequence from value in scout_frames parm."""
    try:
        spec = node.parm("scout_frames").eval()
        return Sequence.create(spec)
    except (ValueError, TypeError):
        return None
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:7,代码来源:frame_spec_ui.py

示例2: test_one_substitution

    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)
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:7,代码来源:test_sequence.py

示例3: test_two_the_same_substitution

    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)
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:7,代码来源:test_sequence.py

示例4: test_counts_from_1_to_10

 def test_counts_from_1_to_10(self):
     s = Sequence.create("1-10")
     ss = s.subsample(1)
     self.assertEqual(len(ss), 1)
     self.assertEqual(list(ss), [6])
     ss = s.subsample(2)
     self.assertEqual(len(ss), 2)
     self.assertEqual(list(ss), [3, 8])
     ss = s.subsample(3)
     self.assertEqual(len(ss), 3)
     self.assertEqual(list(ss), [2, 6, 9])
     ss = s.subsample(4)
     self.assertEqual(len(ss), 4)
     self.assertEqual(list(ss), [2, 4, 7, 9])
     ss = s.subsample(5)
     self.assertEqual(len(ss), 5)
     self.assertEqual(list(ss), [2, 4, 6, 8, 10])
     ss = s.subsample(6)
     self.assertEqual(len(ss), 6)
     self.assertEqual(list(ss), [1, 3, 5, 6, 8, 10])
     ss = s.subsample(7)
     self.assertEqual(len(ss), 7)
     self.assertEqual(list(ss), [1, 3, 4, 6, 7, 8, 10])
     ss = s.subsample(8)
     self.assertEqual(len(ss), 8)
     self.assertEqual(list(ss), [1, 2, 4, 5, 6, 7, 9, 10])
     ss = s.subsample(9)
     self.assertEqual(len(ss), 9)
     self.assertEqual(list(ss), [1, 2, 3, 4, 6, 7, 8, 9, 10])
     ss = s.subsample(10)
     self.assertEqual(len(ss), 10)
     self.assertEqual(list(ss), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
     ss = s.subsample(11)
     self.assertEqual(len(ss), 10)
     self.assertEqual(list(ss), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:35,代码来源:test_sequence.py

示例5: test_chunk_count

 def test_chunk_count(self):
     s = Sequence.create("1-100")
     s.chunk_size = 7
     self.assertEqual(s.chunk_count(), 15)
     s.chunk_size = 15
     self.assertEqual(s.chunk_count(), 7)
     s.chunk_size = 10
     self.assertEqual(s.chunk_count(), 10)
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:8,代码来源:test_sequence.py

示例6: test_best_chunk_size

 def test_best_chunk_size(self):
     s = Sequence.create("1-100")
     s.chunk_size = 76
     self.assertEqual(s.best_chunk_size(), 50)
     s.chunk_size = 37
     self.assertEqual(s.best_chunk_size(), 34)
     s.chunk_size = 100
     self.assertEqual(s.best_chunk_size(), 100)
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:8,代码来源:test_sequence.py

示例7: test_include_parts_of_sequence_that_exist

    def test_include_parts_of_sequence_that_exist(self):
        seq = Sequence.create("96-105")
        result = [
            f for f in dependency_scan.fetch(
                self.node, seq, 3) if f.startswith("/path/to/shader3")]

        self.assertIn("/path/to/shader3/tex.0097.jpg", result)
        self.assertEqual(len(result), 5)
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:8,代码来源:test_dependency_scan.py

示例8: test_create_chunks_cycle

 def test_create_chunks_cycle(self):
     s = Sequence.create("1-100")
     s.chunk_size = 10
     s.chunk_strategy = "cycle"
     chunks = s.chunks()
     self.assertEqual(list(chunks[0]), list(range(1, 100, 10)))
     s.chunk_size = 7
     chunks = s.chunks()
     self.assertEqual(list(chunks[0]), list(range(1, 100, 15)))
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:9,代码来源:test_sequence.py

示例9: initialize

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))
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:10,代码来源:glob.py

示例10: _attribute_sequence

def _attribute_sequence(attr, **kw):
    """Get the sequence associated with a filename attribute.

    Many attributes have an associated sequence_mode attribute, which
    when set to 1 signifies varying frames, and makes availabel start,
    end, and offset attributes to help specify the sequence.

    If the keyword intersector is given, then work out the intersection
    with it. Why? Because during dependency scanning, we can optimize
    the number of frames to upload if we use only those frames specified
    in the sequence attribute, and intersect them with the frame range
    specified in the job node.
    """
    intersector = kw.get("intersector")

    obj = attr.get_parent_object()
    mode_attr = obj.attribute_exists("sequence_mode")
    if not (mode_attr and mode_attr.get_long()):
        ix.log_error("Attribute is not a sequence mode")

    global_frame_rate = ix.application.get_prefs(
        ix.api.AppPreferences.MODE_APPLICATION).get_long_value(
            "animation", "frames_per_second")
    attr_frame_rate = obj.get_attribute("frame_rate").get_long()
    if not attr_frame_rate == global_frame_rate:
        ix.log_error(
            "Can't get attribute sequence when global \
            fps is different from fps on the attribute")

    start = obj.get_attribute("start_frame").get_long()
    end = obj.get_attribute("end_frame").get_long()



    if intersector:
        # If there's a frame offset on the attribute, then we need to 
        # do the intersection in the context of that offset.
        offset = obj.get_attribute("frame_offset").get_long()
        return Sequence.create(start, end, 1).offset(
            offset).intersection(intersector).offset(-offset)

    return Sequence.create(start, end, 1)
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:42,代码来源:dependencies.py

示例11: range_frame_sequence

def range_frame_sequence(node):
    """Generate Sequence from value in the standard range parmTuple."""
    try:
        chunk = _chunk_parameters(node)
        start, end, step = node.parmTuple("fs").eval()
        return Sequence.create(
            start, end, step,
            chunk_size=chunk["size"],
            chunk_strategy=chunk["strategy"])
    except (ValueError, TypeError):
        return None
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:11,代码来源:frame_spec_ui.py

示例12: custom_frame_sequence

def custom_frame_sequence(node):
    """Generate Sequence from value in custom_range parm."""
    try:
        spec = node.parm("custom_range").eval()
        chunk = _chunk_parameters(node)
        return Sequence.create(
            spec,
            chunk_size=chunk["size"],
            chunk_strategy=chunk["strategy"]
        )
    except (ValueError, TypeError):
        return None
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:12,代码来源:frame_spec_ui.py

示例13: test_three_substitutions

 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)
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:12,代码来源:test_sequence.py

示例14: validate_scout_range

def validate_scout_range(node, **_):
    """Set valid tickmark for scout range spec.

    TODO Currently we only validate that the spec produces
    valid frames. We should also validate that at least one
    scout frame exist in the main frame range.
    """
    takes.enable_for_current(node, "scout_valid")
    spec = node.parm("scout_frames").eval()
    valid = Sequence.is_valid_spec(spec)
    node.parm("scout_valid").set(valid)
    update_frame_stats_message(node)
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:12,代码来源:frame_spec_ui.py

示例15: validate_custom_range

def validate_custom_range(node, **_):
    """Set valid tickmark for custom range spec.

    A custom range is valid when it is a comma separated
    list of arithmetic progressions. These can can be
    formatted as single numbers or ranges with a hyphen and
    optionally a step value delimited by an x. Example,
    1,7,10-20,30-60x3,1001, Spaces and trailing commas are
    allowed, but not letters or other non numeric
    characters.
    """
    takes.enable_for_current(node, "custom_valid")
    spec = node.parm("custom_range").eval()
    valid = Sequence.is_valid_spec(spec)
    node.parm("custom_valid").set(valid)

    update_frame_stats_message(node)
    uistate.update_button_state(node)
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:18,代码来源:frame_spec_ui.py


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