forked from ArturoAmaya/ExploratoryCurricularAnalytics
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CourseMetrics.jl
56 lines (50 loc) · 1.65 KB
/
CourseMetrics.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
module CourseMetrics
include("Output.jl")
include("Utils.jl")
import CurricularAnalytics: blocking_factor, centrality, complexity, Curriculum, delay_factor
import .Output: output, plans, termname
import .Utils: convert, writerow
open("./files/courses_fa12.csv", "w") do file
writerow(file, [
"Year",
"Major",
"Course",
"Complexity",
"Centrality",
"Year taken in plan",
"Blocking factor",
"Delay factor",
])
for year in 2015:2050
if year ∉ keys(plans)
break
end
for major in sort(collect(keys(plans[year])))
degree_plans = output(year, major)
curriculum_college = first(
college
for college in ["TH", "WA", "SN", "MU", "FI", "RE", "SI", "EI"]
if college ∈ keys(degree_plans) && !(college == "SN" && year < 2020)
)
curriculum = convert(Curriculum, degree_plans[curriculum_college])
for (i, course) in enumerate(curriculum.courses)
if course.prefix == "" || course.institution != "DEPARTMENT"
continue
end
writerow(file, [
string(year), # Year
major, # Major
"$(course.prefix) $(course.num)", # Course
string(complexity(curriculum, i)), # Complexity
string(centrality(curriculum, i)), # Centrality
# Use the curriculum college's year, even though it could vary between
# colleges
string((findfirst(course ∈ term.courses for term in degree_plans[curriculum_college].terms) - 1) ÷ 3 + 1),
string(blocking_factor(curriculum, i)), # Blocking factor
string(delay_factor(curriculum, i)), # Delay factor
])
end
end
end
end
end