Skip to content

Commit

Permalink
Add support for Advanced Computer Science degree
Browse files Browse the repository at this point in the history
  • Loading branch information
lhvy committed Jul 6, 2024
1 parent 13de062 commit 21056ce
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 33 deletions.
Binary file modified backend/data/final_data/conditions.pkl
Binary file not shown.
6 changes: 3 additions & 3 deletions backend/data/final_data/conditionsProcessed.json
Original file line number Diff line number Diff line change
Expand Up @@ -3663,7 +3663,7 @@
},
"COMP4920": {
"original": "Prerequisite: (COMP2511 or COMP2911) and completion of 96 UOC in Computer Science.<br/><br/>",
"processed": "(COMP2511 || COMP2911) && 96UOC && COMP?1"
"processed": "(COMP2511 || COMP2911) && 96UOC && (COMP?1 || COMP?H)"
},
"COMP4951": {
"original": "Prerequisite: Enrolled in a CSE BE (Hons) programs, completion of 126 UOC and completion of 3rd year core.<br/><br/>",
Expand All @@ -3680,7 +3680,7 @@
},
"COMP4961": {
"original": "Prerequisite: Students enrolled in program 4515 Bachelor of Computer Science (Hons) or program 3648.<br/><br/>",
"processed": "4515 || 3648"
"processed": "4515 || 3779"
},
"COMP4962": {
"original": "COMP4962 Prerequisite: Students must successfully complete COMP4951<br/><br/>",
Expand Down Expand Up @@ -12696,4 +12696,4 @@
"original": "",
"processed": ""
}
}
}
6 changes: 5 additions & 1 deletion backend/data/final_data/conditionsTokens.json
Original file line number Diff line number Diff line change
Expand Up @@ -8112,7 +8112,11 @@
"&&",
"96UOC",
"&&",
"(",
"COMP?1",
"||",
"COMP?H",
")",
")"
],
"COMP4951": [
Expand Down Expand Up @@ -8142,7 +8146,7 @@
"(",
"4515",
"||",
"3648",
"3779",
")"
],
"COMP4962": [
Expand Down
42 changes: 21 additions & 21 deletions backend/data/final_data/specialisationsProcessed.json
Original file line number Diff line number Diff line change
Expand Up @@ -2755,9 +2755,9 @@
},
{
"courses": {
"any Level 9 Computer Science course": 1,
"any Level 6 Computer Science course": 1,
"any Level 4 Computer Science course": 1
"COMP9": "any Level 9 Computer Science course",
"COMP6": "any Level 6 Computer Science course",
"COMP4": "any Level 4 Computer Science course"
},
"title": "Advanced Computing Electives",
"credits_to_complete": 30,
Expand All @@ -2767,13 +2767,13 @@
},
{
"courses": {
"any Level 9 Computer Science course": 1,
"any Level 6 Computer Science course": 1,
"any Level 3 Computer Science course": 1,
"COMP9": "any Level 9 Computer Science course",
"COMP6": "any Level 6 Computer Science course",
"COMP3": "any Level 3 Computer Science course",
"ENGG3600": "Engineering Vertically Integrated Project",
"ENGG4600": "Engineering Vertically Integrated Project",
"ENGG2600": "Engineering Vertically Integrated Project",
"any Level 4 Computer Science course": 1
"COMP4": "any Level 4 Computer Science course"
},
"title": "Computing Electives",
"credits_to_complete": 30,
Expand Down Expand Up @@ -3021,10 +3021,10 @@
},
{
"courses": {
"any Level 4 Computer Science course": 1,
"any Level 3 Computer Science course": 1,
"any Level 9 Computer Science course": 1,
"any Level 6 Computer Science course": 1,
"COMP4": "any Level 4 Computer Science course",
"COMP3": "any Level 3 Computer Science course",
"COMP9": "any Level 9 Computer Science course",
"COMP6": "any Level 6 Computer Science course",
"ENGG2600": "Engineering Vertically Integrated Project",
"ENGG4600": "Engineering Vertically Integrated Project",
"ENGG3600": "Engineering Vertically Integrated Project"
Expand All @@ -3047,9 +3047,9 @@
},
{
"courses": {
"any Level 6 Computer Science course": 1,
"any Level 9 Computer Science course": 1,
"any Level 4 Computer Science course": 1
"COMP6": "any Level 6 Computer Science course",
"COMP9": "any Level 9 Computer Science course",
"COMP4": "any Level 4 Computer Science course"
},
"title": "Advanced Computing Electives",
"credits_to_complete": 12,
Expand Down Expand Up @@ -3430,9 +3430,9 @@
},
{
"courses": {
"any Level 4 Computer Science course": 1,
"any Level 9 Computer Science course": 1,
"any Level 6 Computer Science course": 1
"COMP4": "any Level 4 Computer Science course",
"COMP9": "any Level 9 Computer Science course",
"COMP6": "any Level 6 Computer Science course"
},
"title": "Advanced Computing Electives",
"credits_to_complete": 12,
Expand Down Expand Up @@ -3473,13 +3473,13 @@
},
{
"courses": {
"any Level 6 Computer Science course": 1,
"COMP6": "any Level 6 Computer Science course",
"ENGG4600": "Engineering Vertically Integrated Project",
"ENGG3600": "Engineering Vertically Integrated Project",
"ENGG2600": "Engineering Vertically Integrated Project",
"any Level 3 Computer Science course": 1,
"any Level 4 Computer Science course": 1,
"any Level 9 Computer Science course": 1
"COMP3": "any Level 3 Computer Science course",
"COMP4": "any Level 4 Computer Science course",
"COMP9": "any Level 9 Computer Science course"
},
"title": "Computing Electives",
"credits_to_complete": 24,
Expand Down
8 changes: 4 additions & 4 deletions backend/data/processors/manual_fixes/COMPFixes.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def COMP_4920():
"original": "Prerequisite: (COMP2511 or COMP2911) and completion of 96 UOC in Computer Science.<br/><br/>",
"processed": "(COMP2511 || COMP2911) && 96UOC in Computer Science"
"""
return "(COMP2511 || COMP2911) && 96UOC && COMP?1"
return "(COMP2511 || COMP2911) && 96UOC && (COMP?1 || COMP?H)"

def COMP_4951(conditions):
"""
Expand Down Expand Up @@ -170,11 +170,11 @@ def COMP_4953():

def COMP_4961():
"""
"original": "Prerequisite: Students enrolled in program 4515 Bachelor of Computer Science (Hons) or program 3648.<br/><br/>",
"original": "Prerequisite: Enrolment in 4515 Computer Science (Hons) or 3779 Advanced Computer Science (Hons)<br/><br/>",
"processed": "4515 || 3648"
"processed": "4515 || 3779"
"""
return "4515 || 3648"
return "4515 || 3779"


def COMP_6445():
Expand Down
6 changes: 3 additions & 3 deletions backend/data/processors/specialisations_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ def get_courses(
for course, title in container_courses.items():
description = description + "" # prevent unused variable error

if "any course" in course:
if "any course" in course.lower():
course_processed = {"any course": "1"}
elif "any level" in course:
elif "any level" in course.lower():
# e.g. modify "any level 4 COMP course" to "COMP4"
course_processed = process_any_level(course)
else:
Expand All @@ -247,7 +247,7 @@ def process_any_level(unprocessed_course: str) -> dict[str, str]:
# group 1 contains level number and group 2 contains program title
# Note '?:' means inner parentheses is non-capturing group
# COMP4XXx
res = re.search(r"level (\d) ((?:[^ ]+ )+)(course)?", unprocessed_course)
res = re.search(r"[lL]evel (\d) ((?:[^ ]+ )+)(course)?", unprocessed_course)
if not res:
print("ERRR BY: ", unprocessed_course)
# TODO: THIS IS BROKEN by `any level 1/2 ...`
Expand Down
2 changes: 1 addition & 1 deletion backend/server/routers/programs.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def get_programs() -> dict[str, dict[str, str]]:
return {
"programs": {
"3778": "Computer Science",
# "3779": "Advanced Computer Science (Honours)", # TODO: Fix the electives
"3779": "Advanced Computer Science (Honours)",
"3502": "Commerce",
"3970": "Science",
"3543": "Economics",
Expand Down

0 comments on commit 21056ce

Please sign in to comment.