aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2021-05-14 01:44:52 +0200
committerMartin Czygan <martin.czygan@gmail.com>2021-05-14 01:44:52 +0200
commitbbf0f6b5959331b5eb6b9bca88ed7da10ceba499 (patch)
tree91926a9420f77e5bf3c2b9a65a8e46aa49b63253 /python
parentc6ad5cd42f7c6a81b258ac3f1fc3faf9b07bf8fb (diff)
downloadrefcat-bbf0f6b5959331b5eb6b9bca88ed7da10ceba499.tar.gz
refcat-bbf0f6b5959331b5eb6b9bca88ed7da10ceba499.zip
tasks: add FatcatMapped
Diffstat (limited to 'python')
-rw-r--r--python/refcat/tasks.py26
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)