Skip to content

Commit 89bdf04

Browse files
committed
improve handling of categories and articles added lists
1 parent 84f5b3d commit 89bdf04

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scripts/1-fetch/arxiv_fetch.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@ def extract_record_metadata(args, record):
270270
metadata["categories"] = categories_elem.text.strip().split()
271271
for index, code in enumerate(metadata["categories"]):
272272
metadata["categories"][index] = SUBSUMED_CATEGORIES.get(code, code)
273+
metadata["categories"] = list(set(metadata["categories"]))
274+
metadata["categories"].sort()
273275
else:
274276
metadata["categories"] = False
275277

@@ -432,6 +434,8 @@ def query_arxiv(args, session):
432434
cc_articles_found += 1
433435

434436
if args.show_added and cc_articles_added:
437+
cc_articles_added = list(set(cc_articles_added))
438+
cc_articles_added.sort()
435439
LOGGER.info(f" CC articles added: {', '.join(cc_articles_added)}")
436440

437441
LOGGER.info(

0 commit comments

Comments
 (0)