Skip to content

Commit

Permalink
fixed issues so tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
heileman committed Aug 21, 2019
1 parent 906bef8 commit 547193f
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/CurricularAnalytics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ end

function write_course_name(buf::IOBuffer, c::Course)
!isempty(c.prefix) ? write(buf, "$(c.prefix) ") : nothing
!isempty(c.num) ? write(buf, "$(c.pnum) - ") : nothing
!isempty(c.num) ? write(buf, "$(c.num) - ") : nothing
write(buf, "$(c.name)") # name is a required item
end

Expand Down
19 changes: 19 additions & 0 deletions src/curriculum.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Curriculum,Underwater Basket Weaving,,,,,,,,
Institution,ACME State University,,,,,,,,
Degree Type,AA,,,,,,,,
System Type,semester,,,,,,,,
CIP,445786,,,,,,,,
Courses,,,,,,,,,
Course ID,Course Name,Prefix,Number,Prerequisites,Corequisites,Strict-Corequisites,Credit Hours,Institution,Canonical Name
1,Introduction to Baskets,BW,101,,,,3,ACME State University,Baskets I
2,Swimming,PE,115,,,,3,ACME State University,Physical Education
3,Introductory Calculus w/ Basketry Applications,MA,116,,,,4,ACME State University,Calculus I
4,Basic Basket Forms,BW,111,1,,5,3,ACME State University,Baskets II
5,Basic Basket Forms Lab,BW,111L,,,,1,ACME State University,Baskets II Laboratory
6,Advanced Basketry,BW,201,"4;5",3,,3,ACME State University,Baskets III
7,Basket Materials & Decoration,BW,214,1,,,3,ACME State University,Basket Materials
8,Underwater Weaving,BW,301,2,7,,3,ACME State University,Baskets IV
9,Humanitites Elective,,,,,,3,ACME State University,Humanitites Core
10,Social Sciences Elective,,,,,,3,ACME State University,
11,Technical Elective,,,,,,3,ACME State University,
12,General Elective,,,,,,3,ACME State University,
26 changes: 26 additions & 0 deletions src/degree_plan.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Curriculum,Underwater Basket Weaving,,,,,,,,,
Degree Plan,4-Term Plan,,,,,,,,,
Institution,ACME State University,,,,,,,,,
Degree Type,AA,,,,,,,,,
System Type,semester,,,,,,,,,
CIP,445786,,,,,,,,,
Courses,,,,,,,,,,
Course ID,Course Name,Prefix,Number,Prerequisites,Corequisites,Strict-Corequisites,Credit Hours,Institution,Canonical Name,Term
1,Introduction to Baskets,BW,101,,,,3,ACME State University,Baskets I,2
2,Swimming,PE,115,,,,3,ACME State University,Physical Education,1
3,Introductory Calculus w/ Basketry Applications,MA,116,13,,,4,ACME State University,Calculus I,3
4,Basic Basket Forms,BW,111,1,,5,3,ACME State University,Baskets II,2
5,Basic Basket Forms Lab,BW,111L,,,,1,ACME State University,Baskets II Laboratory,2
6,Advanced Basketry,BW,201,"4;5",3,,3,ACME State University,Baskets III,3
7,Basket Materials & Decoration,BW,214,1,,,3,ACME State University,Basket Materials,3
8,Underwater Weaving,BW,301,2,7,,3,ACME State University,Baskets IV,4
9,Humanitites Elective,,,,,,3,ACME State University,Humanitites Core,4
10,Social Sciences Elective,,,,,,3,ACME State University,,3
11,Technical Elective,,,,,,3,ACME State University,,4
12,General Elective,,,,,,3,ACME State University,,2
Additional Courses,,,,,,,,,,
Course ID,Course Name,Prefix,Number,Prerequisites,Corequisites,Strict-Corequisites,Credit Hours,Institution,Canonical Name,Term
13,Precalculus w/ Basketry Applications,MA,110,14,,,3,ACME State University,Precalculus,2
14,College Algebra,MA,102,,,15,3,ACME State University,College Algebra,1
15,College Algebra Studio,MA,102S,,,,1,ACME State University,College Algebra Recitation,1
16,Hemp Baskets,BW,420,,6,,3,ACME State University,College Algebra Recitation,4
6 changes: 3 additions & 3 deletions test/CurricularAnalytics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ errors = IOBuffer()
# Test analytics
@test delay_factor(curric) == (19.0, [3.0, 3.0, 3.0, 3.0, 3.0, 2.0, 1.0, 1.0])
@test blocking_factor(curric) == (8, [2, 2, 1, 3, 0, 0, 0, 0])
@test centrality(curric) == (9, [0, 0, 9, 0, 0, 0, 0, 0])
@test centrality(curric) == (3, [0, 0, 3, 0, 0, 0, 0, 0])
@test complexity(curric) == (27.0, [5.0, 5.0, 4.0, 6.0, 3.0, 2.0, 1.0, 1.0])

# Curric: 7-vertex test curriculum - valid
Expand Down Expand Up @@ -170,12 +170,12 @@ basic_metrics(curric)
@test curric.num_courses == 8
@test curric.metrics["blocking factor"] == (8, [2, 2, 1, 3, 0, 0, 0, 0])
@test curric.metrics["delay factor"] == (19.0, [3.0, 3.0, 3.0, 3.0, 3.0, 2.0, 1.0, 1.0])
@test curric.metrics["centrality"] == (9, [0, 0, 9, 0, 0, 0, 0, 0])
@test curric.metrics["centrality"] == (3, [0, 0, 3, 0, 0, 0, 0, 0])
@test curric.metrics["complexity"] == (27.0, [5.0, 5.0, 4.0, 6.0, 3.0, 2.0, 1.0, 1.0])
@test curric.metrics["max. blocking factor"] == 3
@test length(curric.metrics["max. blocking factor courses"]) == 1
@test curric.metrics["max. blocking factor courses"][1].name == "Basic Basket Forms Lab"
@test curric.metrics["max. centrality"] == 9
@test curric.metrics["max. centrality"] == 3
@test length(curric.metrics["max. centrality courses"]) == 1
@test curric.metrics["max. centrality courses"][1].name == "Basic Basket Forms"
@test curric.metrics["max. delay factor"] == 3.0
Expand Down

0 comments on commit 547193f

Please sign in to comment.