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


Python luigi.LocalTarget方法代码示例

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


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

示例1: test_get_uri

# 需要导入模块: import luigi [as 别名]
# 或者: from luigi import LocalTarget [as 别名]
def test_get_uri():

        class TargetWithURI(LocalTarget):
            def uri(self):
                return 'i://have/a/uri'

        class TargetWithPath(LocalTarget):
            pass

        class NotATarget:
            pass

        assert get_uri(TargetWithURI('fake/path')) == 'i://have/a/uri'
        assert get_uri(TargetWithPath('a/path')) == 'a/path'

        try:
            get_uri(NotATarget())
            assert False
        except ValueError as e:
            assert "Unknown input target type" in str(e) 
开发者ID:spotify,项目名称:spotify-tensorflow,代码行数:22,代码来源:luigi_utils_test.py

示例2: output

# 需要导入模块: import luigi [as 别名]
# 或者: from luigi import LocalTarget [as 别名]
def output(self):
        guesser_class = get_class(self.guesser_module, self.guesser_class)
        guesser_targets = [
            LocalTarget(file)
            for file in guesser_class.files(
                AbstractGuesser.output_path(self.guesser_module, self.guesser_class, self.config_num, '')
            )]

        return [
            LocalTarget(AbstractGuesser.output_path(
                self.guesser_module, self.guesser_class, self.config_num, ''
            )),
            LocalTarget(
                AbstractGuesser.output_path(
                    self.guesser_module, self.guesser_class, self.config_num, 'guesser_params.pickle'
                ))
        ] + guesser_targets 
开发者ID:Pinafore,项目名称:qb,代码行数:19,代码来源:guesser.py

示例3: run

# 需要导入模块: import luigi [as 别名]
# 或者: from luigi import LocalTarget [as 别名]
def run(self):
        tm_args = self.get_module_args(TransMap, genome=self.genome)
        logger.info('Running transMap for {}.'.format(self.genome))
        cmd = [['pslMap', '-chainMapFile', tm_args.ref_psl, tm_args.chain_file, '/dev/stdout'],
               ['pslMapPostChain', '/dev/stdin', '/dev/stdout'],
               ['sort', '-k14,14', '-k16,16n'],
               ['pslRecalcMatch', '/dev/stdin', tm_args.two_bit, tm_args.transcript_fasta, 'stdout'],
               ['sort', '-k10,10']]  # re-sort back to query name for filtering
        tmp_file = luigi.LocalTarget(is_tmp=True)
        with tmp_file.open('w') as tmp_fh:
            tools.procOps.run_proc(cmd, stdout=tmp_fh, stderr='/dev/null')
        tm_psl_tgt, tm_gp_tgt = self.output()
        tools.fileOps.ensure_file_dir(tm_psl_tgt.path)
        with tm_psl_tgt.open('w') as outf:
            for psl_rec in tools.psl.psl_iterator(tmp_file.path, make_unique=True):
                tools.fileOps.print_row(outf, psl_rec.psl_string())
        with tm_gp_tgt.open('w') as outf:
            cmd = ['transMapPslToGenePred', '-nonCodingGapFillMax=80', '-codingGapFillMax=50',
                   tm_args.annotation_gp, tm_psl_tgt.path, '/dev/stdout']
            tools.procOps.run_proc(cmd, stdout=outf) 
开发者ID:ComparativeGenomicsToolkit,项目名称:Comparative-Annotation-Toolkit,代码行数:22,代码来源:__init__.py

示例4: output

# 需要导入模块: import luigi [as 别名]
# 或者: from luigi import LocalTarget [as 别名]
def output(self):
        return luigi.LocalTarget('MyQuerySave.csv') 
开发者ID:treasure-data,项目名称:luigi-td,代码行数:4,代码来源:tasks.py

示例5: output

# 需要导入模块: import luigi [as 别名]
# 或者: from luigi import LocalTarget [as 别名]
def output(self):
        return luigi.LocalTarget('test_input.tsv') 
开发者ID:treasure-data,项目名称:luigi-td,代码行数:4,代码来源:test_bulk_import.py

示例6: get_path

# 需要导入模块: import luigi [as 别名]
# 或者: from luigi import LocalTarget [as 别名]
def get_path(self):
        target = self.input()
        # LocalTarget
        if isinstance(target, luigi.LocalTarget):
            return os.path.abspath(target.path)
        # S3Target
        if isinstance(target, luigi.s3.S3Target):
            url = urlparse(target.path)
            return "s3://{aws_access_key_id}:{aws_secret_access_key}@/{bucket}{path}".format(
                aws_access_key_id = target.fs.s3.aws_access_key_id,
                aws_secret_access_key = target.fs.s3.aws_secret_access_key,
                bucket = url.hostname,
                path = url.path
            )
        raise ValueError('unsupported target: {0}'.format(target)) 
开发者ID:treasure-data,项目名称:luigi-td,代码行数:17,代码来源:bulk_import.py

示例7: output

# 需要导入模块: import luigi [as 别名]
# 或者: from luigi import LocalTarget [as 别名]
def output(self):
        return LocalTarget(self.path) 
开发者ID:Pinafore,项目名称:qb,代码行数:4,代码来源:pipeline.py

示例8: output

# 需要导入模块: import luigi [as 别名]
# 或者: from luigi import LocalTarget [as 别名]
def output(self):
        return [LocalTarget(AbstractGuesser.guess_path(bc.GUESSES_DIR, fold)) for fold in c.BUZZER_INPUT_FOLDS] 
开发者ID:Pinafore,项目名称:qb,代码行数:4,代码来源:buzzer.py

示例9: output

# 需要导入模块: import luigi [as 别名]
# 或者: from luigi import LocalTarget [as 别名]
def output(self):
        return LocalTarget('output/summary/{0}.json'.format(self.fold)) 
开发者ID:Pinafore,项目名称:qb,代码行数:4,代码来源:all.py

示例10: output

# 需要导入模块: import luigi [as 别名]
# 或者: from luigi import LocalTarget [as 别名]
def output(self):
        return LocalTarget('data/external/nltk_download_SUCCESS') 
开发者ID:Pinafore,项目名称:qb,代码行数:4,代码来源:preprocess.py


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