diff options
author | Martin Czygan <martin.czygan@gmail.com> | 2021-05-29 02:27:34 +0200 |
---|---|---|
committer | Martin Czygan <martin.czygan@gmail.com> | 2021-05-29 02:27:34 +0200 |
commit | c033a545e83bcbf8d1b99c6c2efd7c75b59d32b0 (patch) | |
tree | f832c4fa7e2adb8ea96f0a560e05e2194048dad2 /python | |
parent | b37a447ae1620c8578d4fd9f221087b265d86cfe (diff) | |
download | refcat-c033a545e83bcbf8d1b99c6c2efd7c75b59d32b0.tar.gz refcat-c033a545e83bcbf8d1b99c6c2efd7c75b59d32b0.zip |
tasks: add UnmatchedOpenLibraryMatchTable
Diffstat (limited to 'python')
-rw-r--r-- | python/refcat/tasks.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/python/refcat/tasks.py b/python/refcat/tasks.py index b8a942c..0656f3c 100644 --- a/python/refcat/tasks.py +++ b/python/refcat/tasks.py @@ -862,3 +862,27 @@ class UnmatchedMapped(Refcat): def output(self): return luigi.LocalTarget(path=self.path(ext="tsv.zst"), format=Zstd) + + +class UnmatchedOpenLibraryMatchTable(Refcat): + """ + Run matching and write tabular results to file. + """ + def requires(self): + return { + "unmatched": UnmatchedMapped(), + "ol": OpenLibraryEditionsMapped(), + } + + def run(self): + output = shellout(""" + skate-reduce -m oled + -O <(zstdcat -T0 {ol}) + -F <(zstdcat -T0 {unmatched}) | + zstd -c > {output} + """, + ol=self.input().get("ol").path, + unmatched=self.input().get("unmatched").path) + + def output(self): + return luigi.LocalTarget(path=self.path(ext="tsv.zst"), format=Zstd) |