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


Python Pipeline.read_input方法代码示例

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


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

示例1: test_add_extension_input_resource_file

# 需要导入模块: from pipeline import Pipeline [as 别名]
# 或者: from pipeline.Pipeline import read_input [as 别名]
 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,代码行数:9,代码来源:test_pipeline.py

示例2: test_read_input_and_write_output

# 需要导入模块: from pipeline import Pipeline [as 别名]
# 或者: from pipeline.Pipeline import read_input [as 别名]
    def test_read_input_and_write_output(self):
        with tempfile.NamedTemporaryFile('w') as input_file, \
                tempfile.NamedTemporaryFile('w') as output_file:
            input_file.write('abc')
            input_file.flush()

            p = Pipeline()
            input = p.read_input(input_file.name)
            p.write_output(input, output_file.name)
            p.run()

            self.assert_same_file(input_file.name, output_file.name)
开发者ID:tpoterba,项目名称:hail,代码行数:14,代码来源:test_pipeline.py

示例3: test_single_task_w_input

# 需要导入模块: from pipeline import Pipeline [as 别名]
# 或者: from pipeline.Pipeline import read_input [as 别名]
    def test_single_task_w_input(self):
        with tempfile.NamedTemporaryFile('w') as input_file, \
                tempfile.NamedTemporaryFile('w') as output_file:
            msg = 'abc'
            input_file.write(msg)
            input_file.flush()

            p = Pipeline()
            input = p.read_input(input_file.name)
            t = p.new_task()
            t.command(f'cat {input} > {t.ofile}')
            p.write_output(t.ofile, output_file.name)
            p.run()

            assert self.read(output_file.name) == msg
开发者ID:tpoterba,项目名称:hail,代码行数:17,代码来源:test_pipeline.py

示例4: test_file_name_space

# 需要导入模块: from pipeline import Pipeline [as 别名]
# 或者: from pipeline.Pipeline import read_input [as 别名]
    def test_file_name_space(self):
        with tempfile.NamedTemporaryFile('w', prefix="some file name with (foo) spaces") as input_file, \
                tempfile.NamedTemporaryFile('w', prefix="another file name with (foo) spaces") as output_file:

            input_file.write('abc')
            input_file.flush()

            p = Pipeline()
            input = p.read_input(input_file.name)
            t = p.new_task()
            t.command(f'cat {input} > {t.ofile}')
            p.write_output(t.ofile, output_file.name)
            p.run()

            self.assert_same_file(input_file.name, output_file.name)
开发者ID:jigold,项目名称:hail,代码行数:17,代码来源:test_pipeline.py


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