From 4fda7f72a87a863641138126c0b0e117a9b93d7b Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Mon, 10 May 2021 23:53:17 +0200 Subject: add RefsDOI --- python/refcat/tasks.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/python/refcat/tasks.py b/python/refcat/tasks.py index 5b54b51..fbe7b1a 100644 --- a/python/refcat/tasks.py +++ b/python/refcat/tasks.py @@ -275,7 +275,7 @@ class UnmatchedRefs(Refcat): class URLTabs(Refcat): """ - Extract (work ident, release ident, url, doc). + Extract (work ident, release ident, url, doc). 519m45.710s (about 55k docs/s). """ def requires(self): return RefsWithUnstructured() @@ -295,4 +295,24 @@ class URLTabs(Refcat): def output(self): return luigi.LocalTarget(path=self.path(ext="tsv.zst"), format=Zstd) +class RefsDOI(Refcat): + """ + Sorted (doi, doc) tuplics from refs. + """ + def requires(self): + return RefsWithUnstructured() + + def run(self): + output = shellout(""" + zstdcat -T0 {input} | + skate-map -m ff -x biblio.doi | + LC_ALL=C sort -T {tmpdir} -k2,2 -S25% --parallel 4 | + zstd -T0 -c > {output} + """, + n=self.n, + 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