Skip to content

Commit

Permalink
Merge pull request #145 from CurricularAnalytics/add_credit_balance
Browse files Browse the repository at this point in the history
Add credit balance
  • Loading branch information
haydenfree authored Jun 12, 2024
2 parents 8b9d0af + 993b1a4 commit d677b0f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "CurricularAnalytics"
uuid = "593ffa3d-269e-5d81-88bc-c3b6809c35a6"
authors = ["Greg Heileman <[email protected]>", "Hayden Free <[email protected]>"]
version = "1.5.0"
version = "1.5.1"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Expand Down
4 changes: 2 additions & 2 deletions src/CurricularAnalytics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ include("DegreePlanCreation.jl")
include("Simulation/Simulation.jl")
include("RequirementsAnalytics.jl")

export AA, AAS, AS, AbstractCourse, AbstractRequirement, BA, BS, Course, CourseCollection, CourseCatalog, CourseRecord, CourseSet, Curriculum, DegreePlan,
export AA, AAS, AS, AbstractCourse, AbstractRequirement, BA, BS, Course, CourseCollection, CourseCatalog, CourseRecord, CourseSet, credit_balance, 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,
courses_from_vertices, create_degree_plan, cross_edge, dead_ends, delay_factor, delete_requisite!, dfs, extraneous_requisites, find_term, forward_edge,
gad, grade, homology, is_duplicate, is_valid, isvalid_curriculum, isvalid_degree_plan, level, longest_path, longest_paths, merge_curricula, pass_table, passrate_table,
pre, postorder_traversal, preorder_traversal, print_plan, quarter, reach, reach_subgraph, reachable_from, reachable_from_subgraph, reachable_to, reachable_to_subgraph,
read_csv, requisite_distance,requisite_type, semester, set_passrates, set_passrate_for_course, set_passrates_from_csv, show_requirements, similarity, simple_students,
read_csv, requisite_distance, requisite_type, semester, set_passrates, set_passrate_for_course, set_passrates_from_csv, show_requirements, similarity, simple_students,
simulate, simulation_report, strict_co, topological_sort, total_credits, transfer_equiv, tree_edge, write_csv, knowledge_transfer, csv_stream

"""
Expand Down
11 changes: 11 additions & 0 deletions src/DegreePlanAnalytics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,15 @@ function requisite_distance(plan::DegreePlan)
distance = distance + requisite_distance(plan, c)
end
return plan.metrics["requisite distance"] = distance
end

#TODO: write docstring, write tests
function credit_balance(plan::DegreePlan)
bal = 0
for i in 1:length(plan.terms)-1
for j in i+1:length(plan.terms)
bal += abs(plan.terms[i].credit_hours - plan.terms[j].credit_hours)
end
end
return bal
end

2 comments on commit d677b0f

@haydenfree
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/108832

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.5.1 -m "<description of version>" d677b0f8284270b9836c1f17f91595f135ff49f5
git push origin v1.5.1

Please sign in to comment.