Update arvix.py
Browse files
arvix.py
CHANGED
@@ -55,8 +55,8 @@ def extract_data(category):
|
|
55 |
return list(all_ids)
|
56 |
|
57 |
def extract_arxiv_data():
|
58 |
-
|
59 |
-
|
60 |
categories = {
|
61 |
"Astrophysics": ["astro-ph"],
|
62 |
"Condensed Matter": ["cond-mat"],
|
@@ -93,8 +93,8 @@ def extract_arxiv_data():
|
|
93 |
while len(category_ids) < 2:
|
94 |
category_ids.add(random.choice(list(used_ids)))
|
95 |
data[category] = {"ids": list(category_ids), "count": len(category_ids)}
|
96 |
-
|
97 |
-
|
98 |
return json.dumps(data, indent=4, ensure_ascii=False)
|
99 |
|
100 |
if __name__ == '__main__':
|
|
|
55 |
return list(all_ids)
|
56 |
|
57 |
def extract_arxiv_data():
|
58 |
+
if not utils.download_datafile('arxiv.txt'):
|
59 |
+
raise Exception("Failed to download datafile")
|
60 |
categories = {
|
61 |
"Astrophysics": ["astro-ph"],
|
62 |
"Condensed Matter": ["cond-mat"],
|
|
|
93 |
while len(category_ids) < 2:
|
94 |
category_ids.add(random.choice(list(used_ids)))
|
95 |
data[category] = {"ids": list(category_ids), "count": len(category_ids)}
|
96 |
+
if not utils.upload_datafile('arxiv.txt'):
|
97 |
+
raise Exception("Failed to upload datafile")
|
98 |
return json.dumps(data, indent=4, ensure_ascii=False)
|
99 |
|
100 |
if __name__ == '__main__':
|