diff options
-rw-r--r-- | python/refcat/tasks.py | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/python/refcat/tasks.py b/python/refcat/tasks.py index 4b70b9f..6aae27f 100644 --- a/python/refcat/tasks.py +++ b/python/refcat/tasks.py @@ -1278,6 +1278,51 @@ class BrefCombined(Refcat): # * [ ] [D] sort COCI by citing (or cited) # * [ ] [E] compare COCI and "ASC" doi matches (as set ops, only COCI, only "ASC", etc + +class ExtraMatchedByWorkIdent(Refcat): + """ + Matched sorted by source work ident. + """ + def requires(self): + return BrefCombined() + + def run(self): + output = shellout(""" + zstdcat -T0 {input} | + skate-map -m bref -skip-on-empty 1 | + LC_ALL=C sort -T {tmpdir} -k1,1 -S25% | + zstd -T0 -c > {output} + """, + tmpdir=self.tmpdir, + input=self.input().path) + luigi.LocalTarget(output).move(self.output().path) + + def output(self): + return luigi.LocalTarget(path=self.path(ext="json.zst"), format=Zstd) + + +class ExtraReleaseByWorkIdent(Refcat): + """ + Fatcat entries by work id. + """ + def requires(self): + return ReleaseExportReduced() + + def run(self): + output = shellout(""" + zstdcat -T0 {input} | + skate-map -m rewo -skip-on-empty 1 | + LC_ALL=C sort -T {tmpdir} -k1,1 -S25% | + zstd -T0 -c > {output} + """, + tmpdir=self.tmpdir, + input=self.input().path) + luigi.LocalTarget(output).move(self.output().path) + + def output(self): + return luigi.LocalTarget(path=self.path(ext="json.zst"), format=Zstd) + + # Extra # ----- # |