Skip to content

Commit

Permalink
Merge pull request #146 from CurricularAnalytics/add_credit_balance
Browse files Browse the repository at this point in the history
add docstring for credit_balance()
  • Loading branch information
haydenfree authored Jun 14, 2024
2 parents d677b0f + e39d588 commit 7bab912
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 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.1"
version = "1.5.2"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Expand Down
15 changes: 14 additions & 1 deletion src/DegreePlanAnalytics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,20 @@ function requisite_distance(plan::DegreePlan)
return plan.metrics["requisite distance"] = distance
end

#TODO: write docstring, write tests
"""
credit_balance(plan::DegreePlan)
For a given degree plan `plan`, this function computes and returns the credit balance among the terms in a degree plan. A
score of `0` indicates perfect balance, i.e., each term in the degree plan has the same number of credit hours. As a degree plan
becomes more imbalanced, in terms of the number of credit hours in each tersm, the credit balance grows larger. If ``t_j``
denotes the number of credit hours in term ``j``, ``j = 1 \ldots m,`` then the credit balance of degree plan `p`, denoted by
``cb^p is given by:
```math
cb^p = \\sum_{i=1}^{m-1}\\abs(t_j - t_{j+1})
```
"""
function credit_balance(plan::DegreePlan)
bal = 0
for i in 1:length(plan.terms)-1
Expand Down

0 comments on commit 7bab912

Please sign in to comment.