timelim_margin may be a float (because safety_margin can be set to, say, 1.2 in problem.yaml), it is not rounded to int in this case:
|
timelim_margin = timelim * safety_margin |
When the new time limit is announced to the user a few lines below, this is (implicitly) rounded downwards because the string expression'%d' % 2.4' apparently gives '2' (while '{:d}.format(2.4)' would have crashed).
Should just be timelim_margin = int(timelim * safety_margin) or maybe timelim_margin = round(timelim * safety_margin) or timelim_margin = int(.5 + timelim * safety_margin).
I’ll fix this (as part of a larger cleanup).
timelim_marginmay be a float (becausesafety_margincan be set to, say,1.2inproblem.yaml), it is not rounded tointin this case:problemtools/problemtools/verifyproblem.py
Line 1380 in 063b68a
When the new time limit is announced to the user a few lines below, this is (implicitly) rounded downwards because the string expression
'%d' % 2.4' apparently gives '2' (while'{:d}.format(2.4)' would have crashed).Should just be
timelim_margin = int(timelim * safety_margin)or maybetimelim_margin = round(timelim * safety_margin)ortimelim_margin = int(.5 + timelim * safety_margin).I’ll fix this (as part of a larger cleanup).