RudolfCardinal/pdn_project_allocation

Error in the verification steps of dense preferences with ties

Closed this issue · 1 comments

Hi there,

first of all, thanks for sharing this project. I used it this year and it proved to be very useful!

I had an issue with one of the possible combination of options. Here is the command line I used:

pdn_project_allocation --allow_student_preference_ties --allow_supervisor_preference_ties --input_rank_notation dense test10_n10_multiple_ties_dense.xlsx

See test10_n10_multiple_ties_dense.xlsx for reproducing the problem.

I believe the content of the file and the command lines are legit but I receive the following error message:

pdn_project_allocation.problem:CRITICAL: Bad preference for student 'S1' in 'Student_preferences' row 2: 1
Bad preference for student 'S1' in 'Student_preferences' row 2: 2
Bad preference for student 'S1' in 'Student_preferences' row 2: 2
Bad preference for student 'S2' in 'Student_preferences' row 3: 1
Bad preference for student 'S2' in 'Student_preferences' row 3: 2
Bad preference for student 'S2' in 'Student_preferences' row 3: 3
Bad preference for student 'S3' in 'Student_preferences' row 4: 1
Bad preference for student 'S3' in 'Student_preferences' row 4: 1
Bad preference for student 'S3' in 'Student_preferences' row 4: 2
[...]

I think the problem is simply due to a flaw in the input validation/transformation process. Inputs are integers initially, which is checked, then transformed into floats because of ties, and the result of the transformation seems checked again, expecting integers. Removing the checks seemed to work just fine (but there is a similar problem with supervisors preferences, again removing the check workes) but it is obviously not a good solution.

Hope this helps,
Etienne.

Thanks, Etienne! Quite right; the preference modes that allow ties permit float values, but the code was insisting on float (when an int would often be fine). I've added your demo to the check. I think there were some small errors, specifically

2024-03-10 17:30:03.132 pdn_project_allocation.problem:CRITICAL: There were spreadsheet errors, in this context: Supervisor_preferences
- ValueError("Error processing preferences for project: 'P4': Bad RankNotation.DENSE preferences in [2, 2, 3]: 1 <= x <= 2 is not true for x = 3")
- ValueError("Error processing preferences for project: 'P5': Bad RankNotation.DENSE preferences in [2, 3]: 1 <= x <= 2 is not true for x = 3")
- ValueError("Error processing preferences for project: 'P8': Bad RankNotation.DENSE preferences in [2, 2, 2]: 1 <= x <= 1 is not true for x = 2")

and I think that's accurate, so I've shifted these preferences down by 1 to be compatible with "dense" notation (e.g. 1, 1, 2 rather than 2, 2, 3).