diff --git a/src/CurricularAnalytics.jl b/src/CurricularAnalytics.jl index 99cd4f4..1afa2df 100644 --- a/src/CurricularAnalytics.jl +++ b/src/CurricularAnalytics.jl @@ -24,7 +24,7 @@ include("DegreePlanAnalytics.jl") include("DegreePlanCreation.jl") include("Simulation/Simulation.jl") -export AA, AAS, AS, AbstractCourse, AbstractRequirement, BA, BS, Course, CourseCollection, CourseCatalog, CourseRecord, CourseSet, Curriculum, Degree, DegreePlan, +export AA, AAS, AS, AbstractCourse, AbstractRequirement, BA, BS, Course, CourseCollection, CourseCatalog, CourseRecord, CourseSet, Curriculum, DegreePlan, EdgeClass, Enrollment, Grade, LearningOutcome, PassRate, RequirementSet, Requisite, Student, StudentRecord, Simulation, System, Term, TransferArticulation, add_course!, add_lo_requisite!, add_requisite!, add_transfer_catalog, add_transfer_course, all_paths, back_edge, basic_metrics, basic_statistics, bin_filling, blocking_factor, centrality, co, compare_curricula, convert_ids, complexity, course, course_from_id, course_from_vertex, course_id, @@ -695,7 +695,7 @@ courses must be identical (at the level of memory allocation). Allowable match c """ function merge_curricula(name::AbstractString, c1::Curriculum, c2::Curriculum, match_criteria::Array{String}=Array{String,1}(); - learning_outcomes::Array{LearningOutcome}=Array{LearningOutcome,1}(), degree_type::Degree=BS, system_type::System=semester, + learning_outcomes::Array{LearningOutcome}=Array{LearningOutcome,1}(), degree_type::AbstractString=BS, system_type::System=semester, institution::AbstractString="", CIP::AbstractString="") merged_courses = deepcopy(c1.courses) extra_courses = Array{Course,1}() # courses in c2 but not in c1 diff --git a/src/DataHandler.jl b/src/DataHandler.jl index 865162a..5f68f92 100644 --- a/src/DataHandler.jl +++ b/src/DataHandler.jl @@ -26,13 +26,13 @@ function read_csv(file_path::AbstractString) if typeof(file_path) == Bool && !file_path return false end - dict_curric_degree_type = Dict("AA"=>AA, "AS"=>AS, "AAS"=>AAS, "BA"=>BA, "BS"=>BS, ""=>BS) + # dict_curric_degree_type = Dict("AA"=>AA, "AS"=>AS, "AAS"=>AAS, "BA"=>BA, "BS"=>BS, ""=>BS) dict_curric_system = Dict("semester"=>semester, "quarter"=>quarter, ""=>semester) dp_name = "" dp_add_courses = Array{Course,1}() curric_name = "" curric_inst = "" - curric_dtype = dict_curric_degree_type["BS"] + curric_dtype = "BS" curric_stype = dict_curric_system["semester"] curric_CIP = "" courses_header = 1 @@ -64,7 +64,7 @@ function read_csv(file_path::AbstractString) courses_header += 1 end if read_line[1] == "Degree Type" - curric_dtype = dict_curric_degree_type[uppercase(read_line[2])] + curric_dtype = read_line[2] read_line = csv_line_reader(readline(csv_file), ',') courses_header += 1 end @@ -198,7 +198,7 @@ function read_csv(file_path::AbstractString) for course in additional_courses push!(ac_arr, course[2]) end - curric = Curriculum(curric_name, all_courses_arr, learning_outcomes = curric_learning_outcomes, degree_type= curric_dtype, + curric = Curriculum(curric_name, all_courses_arr, learning_outcomes = curric_learning_outcomes, degree_type = curric_dtype, system_type=curric_stype, institution=curric_inst, CIP=curric_CIP) terms = read_terms(df_all_courses, all_courses, all_courses_arr) #If some courses has term informations but some does not @@ -215,7 +215,7 @@ function read_csv(file_path::AbstractString) return false end curric_courses_arr = [course[2] for course in curric_courses] - curric = Curriculum(curric_name, curric_courses_arr, learning_outcomes = curric_learning_outcomes, degree_type= curric_dtype, + curric = Curriculum(curric_name, curric_courses_arr, learning_outcomes = curric_learning_outcomes, degree_type = curric_dtype, system_type=curric_stype, institution=curric_inst, CIP=curric_CIP) output = curric end @@ -289,7 +289,7 @@ end function write_csv_content(csv_file, program, is_degree_plan; metrics=false) - dict_curric_degree_type = Dict(AA=>"AA", AS=>"AS", AAS=>"AAS", BA=>"BA", BS=>"BS") + # dict_curric_degree_type = Dict(AA=>"AA", AS=>"AS", AAS=>"AAS", BA=>"BA", BS=>"BS") dict_curric_system = Dict(semester=>"semester", quarter=>"quarter") # Write Curriculum Name if is_degree_plan @@ -313,7 +313,7 @@ function write_csv_content(csv_file, program, is_degree_plan; metrics=false) write(csv_file, curric_ins) # Write Degree Type - curric_dtype = "\nDegree Type," *"\""* string(dict_curric_degree_type[curric.degree_type]) * "\""*",,,,,,,,," + curric_dtype = "\nDegree Type," *"\""* string(curric.degree_type) * "\""*",,,,,,,,," write(csv_file,curric_dtype) # Write System Type (Semester or Quarter) diff --git a/src/DataTypes/Curriculum.jl b/src/DataTypes/Curriculum.jl index 168cd71..c5acc73 100644 --- a/src/DataTypes/Curriculum.jl +++ b/src/DataTypes/Curriculum.jl @@ -13,8 +13,7 @@ Required: - `name::AbstractString` : the name of the curriculum. - `courses::Array{Course}` : the collection of required courses that comprise the curriculum. Keyword: -- `degree_type::Degree` : the type of degree, allowable - types: `AA`, `AS`, `AAS`, `BA`, `BS` (default). +- `degree_type::AbstractString` : the type of degree, e.g. BA, BBA, BSc, BEng, etc. - `institution:AbstractString` : the name of the institution offering the curriculum. - `system_type::System` : the type of system the institution uses, allowable types: `semester` (default), `quarter`. @@ -30,7 +29,7 @@ mutable struct Curriculum id::Int # Unique curriculum ID name::AbstractString # Name of the curriculum (can be used as an identifier) institution::AbstractString # Institution offering the curriculum - degree_type::Degree # Type of degree_type + degree_type::AbstractString # Type of degree_type system_type::System # Semester or quarter system CIP::AbstractString # CIP code associated with the curriculum courses::Array{AbstractCourse} # Array of required courses in curriculum @@ -48,7 +47,7 @@ mutable struct Curriculum # Constructor function Curriculum(name::AbstractString, courses::Array{AbstractCourse}; learning_outcomes::Array{LearningOutcome}=Array{LearningOutcome,1}(), - degree_type::Degree=BS, system_type::System=semester, institution::AbstractString="", CIP::AbstractString="", + degree_type::AbstractString="BS", system_type::System=semester, institution::AbstractString="", CIP::AbstractString="", id::Int=0, sortby_ID::Bool=true) this = new() this.name = name @@ -86,7 +85,7 @@ mutable struct Curriculum end function Curriculum(name::AbstractString, courses::Array{Course}; learning_outcomes::Array{LearningOutcome}=Array{LearningOutcome,1}(), - degree_type::Degree=BS, system_type::System=semester, institution::AbstractString="", CIP::AbstractString="", + degree_type::AbstractString="BS", system_type::System=semester, institution::AbstractString="", CIP::AbstractString="", id::Int=0, sortby_ID::Bool=true) Curriculum(name, convert(Array{AbstractCourse},courses), learning_outcomes=learning_outcomes, degree_type=degree_type, system_type=system_type, institution=institution, CIP=CIP, id=id, sortby_ID=sortby_ID) diff --git a/src/DataTypes/DataTypes.jl b/src/DataTypes/DataTypes.jl index db8d0e1..9077586 100644 --- a/src/DataTypes/DataTypes.jl +++ b/src/DataTypes/DataTypes.jl @@ -1,7 +1,7 @@ # file: DataTypes.jl # Enumerated types -@enum Degree AA AS AAS BA BAAS BAH BBA BDes BE BED BFA BGS BIS BLA BLS BM BME BMS BMus BPS BRIT BS BSAS BSBA BSBE BSCE BSCH BSCP BSCS BSCYS BSE BSEd BSEE BSEV BSIE BSIS BSIT BSME BSN BSPH BSW BTAS +# @enum Degree AA AS AAS BA BAAS BAH BBA BDes BE BED BFA BGS BIS BLA BLS BM BME BMS BMus BPS BRIT BS BSAS BSBA BSBE BSCE BSCH BSCP BSCS BSCYS BSE BSEd BSEE BSEV BSIE BSIS BSIT BSME BSN BSPH BSW BTAS @enum System semester quarter @enum Requisite pre co strict_co custom belong_to @enum EdgeClass tree_edge back_edge forward_edge cross_edge diff --git a/test/DataHandler.jl b/test/DataHandler.jl index 1fd2e80..261ca5d 100644 --- a/test/DataHandler.jl +++ b/test/DataHandler.jl @@ -7,7 +7,7 @@ curric = read_csv("./curriculum.csv") @test curric.name == "Underwater Basket Weaving" @test curric.institution == "ACME State University" -@test curric.degree_type == AA +@test curric.degree_type == "AA" @test curric.system_type == semester @test curric.CIP == "445786" @test length(curric.courses) == 12 @@ -113,7 +113,7 @@ dp = read_csv("degree_plan.csv") @test dp.name == "4-Term Plan" @test dp.curriculum.name == "Underwater Basket Weaving" @test dp.curriculum.institution == "ACME State University" -@test dp.curriculum.degree_type == AA +@test dp.curriculum.degree_type == "AA" @test dp.curriculum.system_type == semester @test dp.curriculum.CIP == "445786" @test length(dp.curriculum.courses)-length(dp.additional_courses) == 12 diff --git a/test/DataTypes.jl b/test/DataTypes.jl index 3ff62a8..f9c10e4 100644 --- a/test/DataTypes.jl +++ b/test/DataTypes.jl @@ -44,7 +44,7 @@ add_requisite!(A,C,pre); # Test Curriciulum creation @test curric.name == "Underwater Basket Weaving" @test curric.institution == "ACME State University" -@test curric.degree_type == BS +@test curric.degree_type == "BS" @test curric.system_type == semester @test curric.CIP == "445786" @test curric.num_courses == 8