diff options
author | Martin Czygan <martin.czygan@gmail.com> | 2021-05-14 01:44:52 +0200 |
---|---|---|
committer | Martin Czygan <martin.czygan@gmail.com> | 2021-05-14 01:44:52 +0200 |
commit | bbf0f6b5959331b5eb6b9bca88ed7da10ceba499 (patch) | |
tree | 91926a9420f77e5bf3c2b9a65a8e46aa49b63253 | |
parent | c6ad5cd42f7c6a81b258ac3f1fc3faf9b07bf8fb (diff) | |
download | refcat-bbf0f6b5959331b5eb6b9bca88ed7da10ceba499.tar.gz refcat-bbf0f6b5959331b5eb6b9bca88ed7da10ceba499.zip |
tasks: add FatcatMapped
-rw-r--r-- | python/refcat/tasks.py | 26 |
1 files changed, 26 insertions, 0 deletions
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) |