Closed lonnychen closed 6 months ago
Should work now, hopefully (test passed)
All four issues here have been fixed as of this commit!
Logging output below where s6
does successfully get matched into the full p3
, s4
is correctly displaced, and kept_assignees
are indeed kept:
INFO:matching_algorithm:Process student s6 INFO:matching_algorithm:Check project p3 with availability 0 INFO:reevaluate_assignments:Reevaluating p3 with potential addition of s6 DEBUG:reevaluate_assignments:current_assignees: ['s1', 's3', 's4'] DEBUG:reevaluate_assignments:kept_assignees: ['s1', 's6', 's3'] DEBUG:reevaluate_assignments:displaced_students: ['s4'] INFO:reevaluate_assignments:Displacing s4 from p3 INFO:reevaluate_assignments:Updated project assignments for p3: ['s1', 's6', 's3'] INFO:matching_algorithm:Updated project assignments: defaultdict(<class 'list'>, {'p3': ['s1', 's6', 's3'], 'p2': ['s2'], 'p1': ['s5']}) DEBUG:matching_algorithm:Updated unassigned students: deque(['s7', 's8', 's9', 's4'])
Reference from commit comment:
Running
test_td_1
from test_algorithm.py and addinglogging
statements to matching_algorithm.py, I get the following output trace which is hopefully explanatory whens6
tries to match withp3
:INFO:matching_algorithm:Project assignments: defaultdict(<class 'list'>, {'p3': ['s1', 's3', 's4'], 'p2': ['s2'], 'p1': ['s5']}) INFO:matching_algorithm:Process student s6 DEBUG:matching_algorithm:Check project p3 with availability 0 DEBUG:reevaluate_assignments:current_assignees: ['s1', 's3', 's4'] DEBUG:reevaluate_assignments:preferred_assignees before: ['s1', 's3', 's4'] DEBUG:reevaluate_assignments:preferred_assignees after: [] DEBUG:matching_algorithm:Returned displaced None INFO:matching_algorithm:Project assignments: defaultdict(<class 'list'>, {'p3': [], 'p2': ['s2'], 'p1': ['s5']}) INFO:matching_algorithm:Process student s7 DEBUG:matching_algorithm:Check project p2 with availability 2 DEBUG:matching_algorithm:Check project p3 with availability 0
Algorithm issues to resolve:
reevaluate_assignments
) aspreferred_assignees
is the same ascurrent_assignees
.displaced
students for processing in the main function.project_availability['p3']
is not updated although it was emptied.The resulting matches table from the Flask App is below: