diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2019-05-30 14:47:58 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2019-05-30 14:47:58 -0700 |
commit | d6ab59e69c3235b5ac4085624987b45c25f577ec (patch) | |
tree | 6f981e5c3a92d2e84bce5dad9ec87d3484d7b7df | |
parent | 8dea77ade1c7c72c25bfb2cd9907c84840206ce6 (diff) | |
download | fatcat-d6ab59e69c3235b5ac4085624987b45c25f577ec.tar.gz fatcat-d6ab59e69c3235b5ac4085624987b45c25f577ec.zip |
better KBART merging
-rwxr-xr-x | extra/journal_metadata/parse_merge_metadata.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/extra/journal_metadata/parse_merge_metadata.py b/extra/journal_metadata/parse_merge_metadata.py index 9e5a4076..7e75cf84 100755 --- a/extra/journal_metadata/parse_merge_metadata.py +++ b/extra/journal_metadata/parse_merge_metadata.py @@ -122,8 +122,6 @@ def test_gaps(): [[1950, 1954], [1957, 1964], [1966, 1970]] def merge_spans(old, new): - print(old) - print(new) if not new: return old if not old: @@ -557,9 +555,9 @@ class Munger(): issnl, row['date_first_issue_online'], row['date_last_issue_online'])) - new_spans = [end, start] + new_spans = [[end, start]] else: - new_spans = [start, end] + new_spans = [[start, end]] self.data[issnl]['kbart'][name]['year_spans'] = merge_spans(old_spans, new_spans) print(counts) @@ -664,6 +662,9 @@ class Munger(): print(counts) if __name__=='__main__': + if len(sys.argv) != 2 or sys.argv[1].startswith('-'): + print("pass me path for an output JSON lines file") + sys.exit(-1) munger = Munger() munger.run(sys.argv[1]) |