From 7efcf41275ad8d8e4d28bc7beae435f20121c487 Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Fri, 14 May 2021 09:58:39 +0200 Subject: add task: RefsToRelease --- python/refcat/tasks.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/python/refcat/tasks.py b/python/refcat/tasks.py index 6fefc6a..3dcdd65 100644 --- a/python/refcat/tasks.py +++ b/python/refcat/tasks.py @@ -415,6 +415,26 @@ class RefsArxiv(Refcat): return luigi.LocalTarget(path=self.path(ext="tsv.zst"), format=Zstd) +class RefsToRelease(Refcat): + """ + Convert refs to release. + """ + def requires(self): + return RefsWithUnstructured() + + def run(self): + output = shellout(""" + zstdcat -T0 {input} | + skate-conv -f ref -w 24 -b 100000 | + zstd -T0 -c > {output} + """, + 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) + + class FatcatDOI(Refcat): """ DOI from fatcat. -- cgit v1.2.3