From fab8895268545575e0da9258bca2def6ce67550b Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 3 May 2019 19:15:22 +0200 Subject: if not --- scraper/s2-final-report.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scraper/s2-final-report.py') diff --git a/scraper/s2-final-report.py b/scraper/s2-final-report.py index 854aa940..29b701b5 100644 --- a/scraper/s2-final-report.py +++ b/scraper/s2-final-report.py @@ -134,6 +134,8 @@ def process_single_paper(row, paper_id, addresses, aggregate_citations, unknown_ if paper_id == 'search': dataset = row['key'] fn = 'datasets/s2/search_papers/{}.json'.format(dataset) + if not os.path.exists(fn): + return with open(fn, 'r') as f: citations = json.load(f) data = { 'citations': [ { 'paperId': paperId } for paperId in citations ] } -- cgit v1.2.3-70-g09d2 From 715cad30012b1530f2316c80c8d6594e9d7b4f25 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 3 May 2019 19:18:13 +0200 Subject: k --- scraper/s2-final-report.py | 1 + 1 file changed, 1 insertion(+) (limited to 'scraper/s2-final-report.py') diff --git a/scraper/s2-final-report.py b/scraper/s2-final-report.py index 29b701b5..8d42a52b 100644 --- a/scraper/s2-final-report.py +++ b/scraper/s2-final-report.py @@ -136,6 +136,7 @@ def process_single_paper(row, paper_id, addresses, aggregate_citations, unknown_ fn = 'datasets/s2/search_papers/{}.json'.format(dataset) if not os.path.exists(fn): return + print('>> {} {}'.format(data['paperId'], 'search results')) with open(fn, 'r') as f: citations = json.load(f) data = { 'citations': [ { 'paperId': paperId } for paperId in citations ] } -- cgit v1.2.3-70-g09d2