本文整理汇总了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)
示例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
示例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)
示例4: output
# 需要导入模块: import luigi [as 别名]
# 或者: from luigi import LocalTarget [as 别名]
def output(self):
return luigi.LocalTarget('MyQuerySave.csv')
示例5: output
# 需要导入模块: import luigi [as 别名]
# 或者: from luigi import LocalTarget [as 别名]
def output(self):
return luigi.LocalTarget('test_input.tsv')
示例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))
示例7: output
# 需要导入模块: import luigi [as 别名]
# 或者: from luigi import LocalTarget [as 别名]
def output(self):
return LocalTarget(self.path)
示例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]
示例9: output
# 需要导入模块: import luigi [as 别名]
# 或者: from luigi import LocalTarget [as 别名]
def output(self):
return LocalTarget('output/summary/{0}.json'.format(self.fold))
示例10: output
# 需要导入模块: import luigi [as 别名]
# 或者: from luigi import LocalTarget [as 别名]
def output(self):
return LocalTarget('data/external/nltk_download_SUCCESS')