Skip to content

Commit

Permalink
Fix hiring coverage calculation (#584)
Browse files Browse the repository at this point in the history
  • Loading branch information
KrisJordan authored Aug 15, 2024
1 parent 9c80cb4 commit 69ad15d
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions backend/services/academics/hiring.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,16 +565,20 @@ def _hiring_status_model(
def _calculate_coverage(
self, enrollment: int, assignments: list[HiringAssignmentEntity]
) -> float:
assignment_count_non_ior = len(
[
assignment
for assignment in assignments
if assignment.hiring_level.classification
!= HiringLevelClassification.IOR
]
)
coverage = (float(enrollment) / 60.0) - (float(assignment_count_non_ior) / 4.0)
return coverage
coverage: float = 0.0
for assignment in assignments:
if assignment.hiring_level.classification in {
HiringLevelClassification.MS,
HiringLevelClassification.PHD,
}:
coverage += assignment.hiring_level.load
elif assignment.hiring_level.classification == HiringLevelClassification.UG:
coverage += assignment.hiring_level.load * 0.25
else:
# IOR
coverage += 0

return (float(enrollment) / 60.0) - coverage

def get_hiring_admin_overview(
self, subject: User, term_id: str
Expand Down

0 comments on commit 69ad15d

Please sign in to comment.