From 3e17f3d42679d5605779e426aa1ba28566f9082b Mon Sep 17 00:00:00 2001 From: Austin Jackson Date: Fri, 10 Feb 2023 10:24:52 -0600 Subject: [PATCH] remove duplicates from searchable courses.json --- bundler/bundle/publications_courses.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bundler/bundle/publications_courses.py b/bundler/bundle/publications_courses.py index 7204a9a6..ddbefc6a 100644 --- a/bundler/bundle/publications_courses.py +++ b/bundler/bundle/publications_courses.py @@ -65,6 +65,10 @@ def process(source: Path, destination: Path): f'{row["SUBJECT"].strip()} {row["CATALOG NBR"].strip()}', row["COURSE DESCR"] ) for row in records]))) + # get a HashMap from a course name to the description + courseName2Description = dict(unique_courses_with_descriptions) + # de-duplicate by recreating + unique_courses_with_descriptions = sorted([(item, courseName2Description[item]) for item in courseName2Description.keys()]) results = [] missing_desc_counter = 0