conflict data collection
This commit is contained in:
6 files changed
+61
-8
No files matched your search
+1
-1
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# Define global debug function
|
||||
debug = lambda msg : print(f">> Debug: {msg}")
|
||||
debug = lambda data : print(f'>> Debug: {data}') if type(data) == str else print('>> Debug: ', data)
|
||||
@@ -11,6 +11,10 @@ flex = ("XAT--12A-S", "XAT--12B-S")
|
||||
|
||||
most_frequent = lambda l : max(set(l), key = l.count)
|
||||
|
||||
def getGradeFromCourseCode(code: str) -> int:
|
||||
grades = [int(s) for s in code.split("-") if s.isdigit()]
|
||||
return None if len(grades) == 0 else most_frequent(grades)
|
||||
|
||||
def getEstimatedGrade(pupil: dict) -> int:
|
||||
grades = [] # List of all possible grades
|
||||
for request in (r for r in pupil["requests"] if r not in flex):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
import json
|
||||
import csv
|
||||
from estimateGrade import getEstimatedGrade
|
||||
from util.estimateGrade import getEstimatedGrade
|
||||
|
||||
flex= ("XAT--12A-S", "XAT--12B-S")
|
||||
|
||||
|
||||
Reference in new issue
Block a user