tidy code add comments

This commit is contained in:
SowinskiBraeden committed 2022-05-16 21:39:03 -07:00
1 parent d6f86e5013
commit 587b01b857
1 file changed
+7 -4
+7 -4
View File
@@ -43,7 +43,9 @@ from util.generateCourses import getSampleCourses
def getLineNumber(): return currentframe().f_back.f_lineno def getLineNumber(): return currentframe().f_back.f_lineno
def newConflict(pupilNum: str, email: str, type: str, code: str, description: str, logs: dict): # Takes in information to create or add a new conflict
# Returns if the particular student has a previous error
def newConflict(pupilNum: str, email: str, type: str, code: str, description: str, logs: dict) -> bool:
exists = True if pupilNum in logs else False exists = True if pupilNum in logs else False
if exists: logs[pupilNum].append({ if exists: logs[pupilNum].append({
"Pupil #": pupilNum, "Pupil #": pupilNum,
@@ -63,7 +65,6 @@ def newConflict(pupilNum: str, email: str, type: str, code: str, description: st
return exists return exists
minReq, median, classCap = 18, 24, 30 minReq, median, classCap = 18, 24, 30
mockStudents = []
activeCourses = {} activeCourses = {}
running = { running = {
"block1": {}, "block1": {},
@@ -78,6 +79,8 @@ running = {
"block10": {} "block10": {}
} }
# These are the codes for Flex (spare) blocks
# Semester 1 and 2
flex = ["XAT--12A-S", "XAT--12B-S"] flex = ["XAT--12A-S", "XAT--12B-S"]
# V3 differs a lot by V1/2 as it does not focus on fitting the classes # V3 differs a lot by V1/2 as it does not focus on fitting the classes
@@ -88,8 +91,8 @@ flex = ["XAT--12A-S", "XAT--12B-S"]
def generateScheduleV3( def generateScheduleV3(
students: list, students: list,
courses: dict, courses: dict,
blockClassLimit: int=40, blockClassLimit: int=40,
studentsDir: str="../output/students.json", studentsDir: str="../output/students.json",
conflictsDir: str="../output/conflicts.json" conflictsDir: str="../output/conflicts.json"
) -> dict[str, dict]: ) -> dict[str, dict]: