diff options
author | Martin Czygan <martin.czygan@gmail.com> | 2021-05-19 23:01:55 +0200 |
---|---|---|
committer | Martin Czygan <martin.czygan@gmail.com> | 2021-05-19 23:01:55 +0200 |
commit | 6ea3badd277d7b7485692c000efac19951275fbe (patch) | |
tree | 91bf4781c66677ac81e51aa79cc8530582c7c2a6 | |
parent | 9cdef6270986b48746fa7e4a610f1bbeb2ed8d3d (diff) | |
download | refcat-6ea3badd277d7b7485692c000efac19951275fbe.tar.gz refcat-6ea3badd277d7b7485692c000efac19951275fbe.zip |
add BrefZipFuzzy
-rw-r--r-- | python/refcat/tasks.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/python/refcat/tasks.py b/python/refcat/tasks.py index 6d7bf56..c082e0a 100644 --- a/python/refcat/tasks.py +++ b/python/refcat/tasks.py @@ -659,3 +659,28 @@ class BrefZipArxiv(Refcat): def output(self): return luigi.LocalTarget(path=self.path(ext="json.zst"), format=Zstd) + + +class BrefZipFuzzy(Refcat): + """ + Run skate-reduce from two files, fuzzy mode. + """ + mapper = luigi.Parameter(default="ts", description="mapper short name") + + def requires(self): + return { + "refs": RefsMapped(mapper=self.mapper), + "fatcat": FatcatMapped(mapper=self.mapper), + } + + def run(self): + output = shellout(r""" + skate-reduce -m fuzzy -F <(zstdcat -T0 {refs}) -L <(zstdcat -T0 {fatcat}) | + zstd -c -T0 > {output} + """, + refs=self.input().get("refs").path, + fatcat=self.input().get("fatcat").path) + luigi.LocalTarget(output).move(self.output().path) + + def output(self): + return luigi.LocalTarget(path=self.path(ext="json.zst"), format=Zstd) |