diff options
author | Martin Czygan <martin.czygan@gmail.com> | 2021-08-02 16:44:57 +0200 |
---|---|---|
committer | Martin Czygan <martin.czygan@gmail.com> | 2021-08-02 16:44:57 +0200 |
commit | e337df94dc3d4e46ffcf30fa84121fc198e8ac88 (patch) | |
tree | ed1483e4d09f8bcf4f4ecf86ccc504b6ee347d74 /python | |
parent | de9ba70f109da817bdcc3595abf972833f447174 (diff) | |
download | refcat-e337df94dc3d4e46ffcf30fa84121fc198e8ac88.tar.gz refcat-e337df94dc3d4e46ffcf30fa84121fc198e8ac88.zip |
tasks: match follow up tasks
Diffstat (limited to 'python')
-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 # ----- # |