Skip to content

Commit

Permalink
got it working
Browse files Browse the repository at this point in the history
  • Loading branch information
Peedee2002 committed Oct 19, 2022
1 parent 70cbbec commit 480de81
Show file tree
Hide file tree
Showing 19 changed files with 225,703 additions and 73 deletions.
23 changes: 1 addition & 22 deletions cache/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import re
from typing import Any

from algorithms.cache.cache_config import (CACHE_CONFIG, CACHED_EQUIVALENTS_FILE,
from cache.cache_config import (CACHE_CONFIG, CACHED_EQUIVALENTS_FILE,
CACHED_EXCLUSIONS_FILE,
CACHED_WARNINGS_FILE,
CONDITIONS_PROCESSED_FILE,
Expand Down Expand Up @@ -62,27 +62,6 @@ def cache_exclusions():

write_data(cached_exclusions, CACHED_EXCLUSIONS_FILE)


def cache_handbook_note():
"""
Reads from processed conditions and stores the warnings in a map mapping
COURSE: WARNING
NOTE: Condition warnings are created during the manual fix stage, so this
will need to be re-run as more conditions are manually fixed.
"""

conditions = read_data(CONDITIONS_PROCESSED_FILE)

cached_handbook_note = {}

for course, data in conditions.items():
if "handbook_note" in data:
cached_handbook_note[course] = data["handbook_note"]

write_data(cached_handbook_note, CACHED_WARNINGS_FILE)


def cache_mappings():
"""
Writes to mappings.json and courseMappings.json (i.e maps courses to corresponding school/faculty)
Expand Down
14 changes: 7 additions & 7 deletions cache/cache_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@
# "codes" is a list of valid codes
# "keyword_mapping" is a dict where the key is a keyword and the value
# is the codes that keyword maps to
CACHE_CONFIG = "algorithms/cache/cache_config.json"
CACHE_CONFIG = "cache/cache_config.json"

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

PROGRAMS_FORMATTED_FILE = "data/scrapers/programsFormattedRaw.json"

CACHED_EXCLUSIONS_FILE = "algorithms/cache/exclusions.json"
CACHED_EXCLUSIONS_FILE = "data/final_data/exclusions.json"

CACHED_EQUIVALENTS_FILE = "algorithms/cache/equivalents.json"
CACHED_EQUIVALENTS_FILE = "data/final_data/equivalents.json"

CONDITIONS_PROCESSED_FILE = "data/final_data/conditionsProcessed.json"


# OUTPUT SOURCES
CACHED_WARNINGS_FILE = "algorithms/cache/handbook_note.json"
CACHED_WARNINGS_FILE = "data/final_data/handbook_note.json"

MAPPINGS_FILE = "algorithms/cache/mappings.json"
MAPPINGS_FILE = "data/final_data/mappings.json"

COURSE_MAPPINGS_FILE = "algorithms/cache/courseMappings.json"
COURSE_MAPPINGS_FILE = "data/final_data/courseMappings.json"

PROGRAM_MAPPINGS_FILE = "algorithms/cache/programMappings.json"
PROGRAM_MAPPINGS_FILE = "data/final_data/programMappings.json"
Loading

0 comments on commit 480de81

Please sign in to comment.