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


Python pipeline.Pipeline类代码示例

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


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

示例1: on_display

    def on_display(self):
        """
        Rendering callback.
        """
        self._camera.render()

        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)

        self._scale += 0.1
        pipeline = Pipeline(rotation=[0, self._scale, 0],
                            translation=[0, 0, 6],
                            projection=self._projection)
        pipeline.set_camera(self._camera)

        self._effect.set_wvp(pipeline.get_wvp())
        self._effect.set_directional_light(
            self._dir_light_color, self._dir_light_ambient_intensity)

        position, tex_coord = 0, 1
        glEnableVertexAttribArray(position)
        glEnableVertexAttribArray(tex_coord)

        glBindBuffer(GL_ARRAY_BUFFER, self._vbo)
        glVertexAttribPointer(position, 3, GL_FLOAT, GL_FALSE, 20, ctypes.c_void_p(0))
        glVertexAttribPointer(tex_coord, 2, GL_FLOAT, GL_FALSE, 20, ctypes.c_void_p(12))
        glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, self._ibo)

        self._texture.bind(GL_TEXTURE0)
        glDrawElements(GL_TRIANGLES, 18, GL_UNSIGNED_INT, ctypes.c_void_p(0))
        glDisableVertexAttribArray(position)
        glDisableVertexAttribArray(tex_coord)
        glutSwapBuffers()
开发者ID:devforfu,项目名称:pyogldev,代码行数:32,代码来源:glutwindow.py

示例2: bas

def bas(target, fluxcal, phasecal, fringefinder, bpcal, catlist, FLAG_INT,
        FLAG_BATCH, FLAG_DEBUG, FLAG_SILENT, FLAG_LOG, converts,
        StageSelection, confpath, conffile, inpath, inext, outpath, outprefix,
        logpath, logfile, comment, timeformat, prompt):

    # Get all those parameters from above ^
    settings = locals()

    # Inform the CASA logger of what's happening.
    casalog.origin("bas")
    casalog.post("Output from this task is not appended to the CASA log.",
                 priority="INFO")

    # Make sure we can see all the files we need.
    obit_path = "/home/rowell/src/obit/python"
    parseltongue_path = "/usr/local/share/parseltongue/python"
    sys.path.append(obit_path)
    sys.path.append(parseltongue_path)

    # Do what we came here to do.
    p = Pipeline()
    p.set(settings)
    p.start()

    # Return the settings.
    s = p.settings
    return s
开发者ID:JRowell,项目名称:basilisk,代码行数:27,代码来源:task_bas.py

示例3: test_resource_group_get_all_mentioned

 def test_resource_group_get_all_mentioned(self):
     p = Pipeline()
     t = p.new_task()
     t.declare_resource_group(foo={'bed': '{root}.bed', 'bim': '{root}.bim'})
     t.command(f"cat {t.foo.bed}")
     assert(t.foo.bed in t._mentioned)
     assert(t.foo.bim not in t._mentioned)
开发者ID:tpoterba,项目名称:hail,代码行数:7,代码来源:test_pipeline.py

示例4: test_add_extension_input_resource_file

 def test_add_extension_input_resource_file(self):
     input_file1 = '/tmp/data/example1.txt.bgz.foo'
     p = Pipeline()
     in1 = p.read_input(input_file1, extension='.txt.bgz.foo')
     with self.assertRaises(Exception):
         in1.add_extension('.baz')
     assert in1._value.endswith('.txt.bgz.foo')
开发者ID:tpoterba,项目名称:hail,代码行数:7,代码来源:test_pipeline.py

示例5: test_resource_group_get_all_mentioned_dependent_tasks

 def test_resource_group_get_all_mentioned_dependent_tasks(self):
     p = Pipeline()
     t = p.new_task()
     t.declare_resource_group(foo={'bed': '{root}.bed', 'bim': '{root}.bim'})
     t.command(f"cat")
     t2 = p.new_task()
     t2.command(f"cat {t.foo}")
开发者ID:tpoterba,项目名称:hail,代码行数:7,代码来源:test_pipeline.py

示例6: __init__

 def __init__(self):
     self.pipeline = Pipeline()
     self.history_pipeline = Pipeline()
     for plsc in pipelinestages.getPipelineFeedStageClasses():
         self.pipeline.appendStage(plsc())
     for plsc in pipelinestages.getPipelineHistoryFeedStageClasses():
         self.history_pipeline.appendStage(plsc())
开发者ID:pablobesada,项目名称:tw,代码行数:7,代码来源:feed.py

示例7: test_iteration

 def test_iteration(self):
     p1 = Pipe(name='p1')
     p1.pipe_cache = ['ok']
     p2 = Pipe(name='p2')
     p3 = Pipe(name='p3')
     pline = Pipeline(pipes=[p1,p2,p3])
     self.assertEqual(pline.next(),'ok')
开发者ID:jbruce12000,项目名称:septic-tank,代码行数:7,代码来源:test_pipeline.py

示例8: main_pipeline

def main_pipeline(filedir):
    #point it somewhere with a bunch of text files
    pipe = Pipeline(getFileNames(filedir), frequencyCount, pruneCommon, writer)
    pipe.run()
    while(not pipe.isDone()):
        pass
    out.close()
开发者ID:anrosent,项目名称:pipeline,代码行数:7,代码来源:NLP_example.py

示例9: test_when_consumer_yield_none

 def test_when_consumer_yield_none(self):
     pipeline = Pipeline().add(
         PipeBuilder().alias("yield_none").consumer(lambda m: m if m == 0 else None).buffer_size(100).number_of_consumer(2)
     )
     expected = [0]
     actual = [x for x in pipeline.stream(range(100))]
     self.assertEquals(expected, actual)
开发者ID:shin285,项目名称:pipeline,代码行数:7,代码来源:test_pipeline.py

示例10: test_config_dict

def test_config_dict(pipeline_config):
    pipeline = Pipeline([Filename], [PipelineResult], **pipeline_config)
    config_dict = pipeline.get_config()
    print(config_dict)
    assert('Localizer' in config_dict)
    assert('Decoder' in config_dict)
    assert(config_dict['Localizer']['model_path'] == 'REQUIRED')
    assert(config_dict['Decoder']['model_path'] == 'REQUIRED')
开发者ID:BioroboticsLab,项目名称:bb_pipeline,代码行数:8,代码来源:test_pipeline.py

示例11: main

def main(input_file_path, output_file_path):
    pdf_file = open_pdf_file(open(input_file_path, 'rwb'))

    image_processor = Pipeline(pipeline_provider,
                               [layout_handler, ayat_handler, soura_handler],
                               pipeline_consumer, pipeline_validator)
    image_processor.follow(retrive_page_as_image(pdf_file))
    print 'success'
开发者ID:ghitakouadri,项目名称:Tahfiz_mushaf,代码行数:8,代码来源:converter.py

示例12: test_resource_group_get_all_inputs

 def test_resource_group_get_all_inputs(self):
     p = Pipeline()
     input = p.read_input_group(fasta="foo",
                                idx="bar")
     t = p.new_task()
     t.command(f"cat {input.fasta}")
     assert(input.fasta in t._inputs)
     assert(input.idx in t._inputs)
开发者ID:tpoterba,项目名称:hail,代码行数:8,代码来源:test_pipeline.py

示例13: test_pipeline

def test_pipeline():
    p = Pipeline()
    assert(len(p) == 0)
    p = Pipeline([ajob])
    assert(len(p) == 1)
    assert_raises(ValueError, Pipeline, [notjob])
    p.append(ajob)
    assert(len(p) == 2)
开发者ID:matthew-brett,项目名称:reconutils,代码行数:8,代码来源:test_pipeline.py

示例14: test_one_pipe

    def test_one_pipe(self):
        pipeline = Pipeline().add(
            PipeBuilder().alias("multiplier").consumer(lambda m: m * m).buffer_size(100).number_of_consumer(10)
        )
        expected = [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]

        actual = [x for x in pipeline.stream(range(10))]
        actual.sort()
        self.assertEquals(expected, actual)
开发者ID:shin285,项目名称:pipeline,代码行数:9,代码来源:test_pipeline.py

示例15: test_resource_group_mentioned

    def test_resource_group_mentioned(self):
        p = Pipeline()
        t = p.new_task()
        t.declare_resource_group(foo={'bed': '{root}.bed'})
        t.command(f'echo "hello" > {t.foo}')

        t2 = p.new_task()
        t2.command(f'echo "hello" >> {t.foo.bed}')
        p.run()
开发者ID:jigold,项目名称:hail,代码行数:9,代码来源:test_pipeline.py


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