From c033a545e83bcbf8d1b99c6c2efd7c75b59d32b0 Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Sat, 29 May 2021 02:27:34 +0200 Subject: tasks: add UnmatchedOpenLibraryMatchTable --- python/refcat/tasks.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'python') 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) -- cgit v1.2.3