aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/refcat/tasks.py28
1 files changed, 26 insertions, 2 deletions
diff --git a/python/refcat/tasks.py b/python/refcat/tasks.py
index 68ba208..01b3b46 100644
--- a/python/refcat/tasks.py
+++ b/python/refcat/tasks.py
@@ -839,6 +839,7 @@ class OpenLibraryEditionsMapped(Refcat):
# -----
#
+
class UnmatchedMapped(Refcat):
"""
Map unmatched refs (converted to release schema on the fly) to titles to do
@@ -869,12 +870,12 @@ class UnmatchedResolveJournalNames(Refcat):
Keep only the resolved docs (for now).
"""
def requires(self):
- return UnmatchedMapped()
+ return UnmatchedRefs()
def run(self):
output = shellout("""
zstdcat -T0 {input} |
- skate-resolve-journal-name -R -f 2 -B -A {abbrev} |
+ skate-resolve-journal-name -R -f 1 -B -A {abbrev} |
zstd -T0 -c > {output}
""",
abbrev=settings.JOURNAL_ABBREVIATIONS,
@@ -885,6 +886,29 @@ class UnmatchedResolveJournalNames(Refcat):
return luigi.LocalTarget(path=self.path(ext="tsv.zst"), format=Zstd)
+class UnmatchedResolveJournalNamesMapped(Refcat):
+ """
+ Take the augmented unmatched refs data and map the container names (abbrev
+ and full).
+ """
+ def requires(self):
+ return UnmatchedResolveJournalNames()
+
+ def run(self):
+ output = shellout("""
+ zstdcat -T0 {input} |
+ skate-map -m vcns -skip-on-empty 1 |
+ LC_ALL=C sort -T {tmpdir} -k1,1 -S25% --parallel 4 |
+ 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="tsv.zst"), format=Zstd)
+
+
class UnmatchedOpenLibraryMatchTable(Refcat):
"""
Run matching and write tabular results to file. About 50M rows.