From bbf0f6b5959331b5eb6b9bca88ed7da10ceba499 Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Fri, 14 May 2021 01:44:52 +0200 Subject: tasks: add FatcatMapped --- python/refcat/tasks.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'python') diff --git a/python/refcat/tasks.py b/python/refcat/tasks.py index 86a3712..91e017b 100644 --- a/python/refcat/tasks.py +++ b/python/refcat/tasks.py @@ -506,3 +506,29 @@ class FatcatArxiv(Refcat): def output(self): return luigi.LocalTarget(path=self.path(ext="tsv.zst"), format=Zstd) + + +class FatcatMapped(Refcat): + """ + Fatcat mapped "tsand". + """ + mapper = luigi.Parameter(default="ts", help="mapper short name") + + def requires(self): + return ReleaseExportReduced() + + def run(self): + output = shellout(""" + zstdcat -T0 {input} | + skate-map -m {mapper} -skip-on-empty 1 | + LC_ALL=C sort -T {tmpdir} -k1,1 -S25% --parallel 4 | + zstd -T0 -c > {output} + """, + n=self.n, + mapper=self.mapper, + tmpdir=self.tmpdir, + input=self.input().path) + luigi.LocalTarget(output).move(self.output().path) + + def output(self): + return luigi.LocalTarget(path=self.path(ext="tsv.zst"), format=Zstd) -- cgit v1.2.3