Skip to content

Commit 480de81

Browse files
committed
got it working
1 parent 70cbbec commit 480de81

19 files changed

+225703
-73
lines changed

Diff for: cache/cache.py

+1-22
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import re
1010
from typing import Any
1111

12-
from algorithms.cache.cache_config import (CACHE_CONFIG, CACHED_EQUIVALENTS_FILE,
12+
from cache.cache_config import (CACHE_CONFIG, CACHED_EQUIVALENTS_FILE,
1313
CACHED_EXCLUSIONS_FILE,
1414
CACHED_WARNINGS_FILE,
1515
CONDITIONS_PROCESSED_FILE,
@@ -62,27 +62,6 @@ def cache_exclusions():
6262

6363
write_data(cached_exclusions, CACHED_EXCLUSIONS_FILE)
6464

65-
66-
def cache_handbook_note():
67-
"""
68-
Reads from processed conditions and stores the warnings in a map mapping
69-
COURSE: WARNING
70-
71-
NOTE: Condition warnings are created during the manual fix stage, so this
72-
will need to be re-run as more conditions are manually fixed.
73-
"""
74-
75-
conditions = read_data(CONDITIONS_PROCESSED_FILE)
76-
77-
cached_handbook_note = {}
78-
79-
for course, data in conditions.items():
80-
if "handbook_note" in data:
81-
cached_handbook_note[course] = data["handbook_note"]
82-
83-
write_data(cached_handbook_note, CACHED_WARNINGS_FILE)
84-
85-
8665
def cache_mappings():
8766
"""
8867
Writes to mappings.json and courseMappings.json (i.e maps courses to corresponding school/faculty)

Diff for: cache/cache_config.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,25 @@
77
# "codes" is a list of valid codes
88
# "keyword_mapping" is a dict where the key is a keyword and the value
99
# is the codes that keyword maps to
10-
CACHE_CONFIG = "algorithms/cache/cache_config.json"
10+
CACHE_CONFIG = "cache/cache_config.json"
1111

1212
# INPUT SOURCES
1313
COURSES_PROCESSED_FILE = "data/final_data/coursesProcessed.json"
1414

1515
PROGRAMS_FORMATTED_FILE = "data/scrapers/programsFormattedRaw.json"
1616

17-
CACHED_EXCLUSIONS_FILE = "algorithms/cache/exclusions.json"
17+
CACHED_EXCLUSIONS_FILE = "data/final_data/exclusions.json"
1818

19-
CACHED_EQUIVALENTS_FILE = "algorithms/cache/equivalents.json"
19+
CACHED_EQUIVALENTS_FILE = "data/final_data/equivalents.json"
2020

2121
CONDITIONS_PROCESSED_FILE = "data/final_data/conditionsProcessed.json"
2222

2323

2424
# OUTPUT SOURCES
25-
CACHED_WARNINGS_FILE = "algorithms/cache/handbook_note.json"
25+
CACHED_WARNINGS_FILE = "data/final_data/handbook_note.json"
2626

27-
MAPPINGS_FILE = "algorithms/cache/mappings.json"
27+
MAPPINGS_FILE = "data/final_data/mappings.json"
2828

29-
COURSE_MAPPINGS_FILE = "algorithms/cache/courseMappings.json"
29+
COURSE_MAPPINGS_FILE = "data/final_data/courseMappings.json"
3030

31-
PROGRAM_MAPPINGS_FILE = "algorithms/cache/programMappings.json"
31+
PROGRAM_MAPPINGS_FILE = "data/final_data/programMappings.json"

0 commit comments

Comments
 (0)