The cast_spoil_ratio is meant to represent the desired percentage of ballots to spoil when generating sample data.
The current logic uses a random int and a modulo operator, which results in approximately 1% of ballots being spoiled no matter what ratio you use:
if randint(0, 100) % cast_spoil_ratio == 0:
accepted_ballots.append(ballot_box.spoil(ballot))
The
cast_spoil_ratiois meant to represent the desired percentage of ballots to spoil when generating sample data.The current logic uses a random int and a modulo operator, which results in approximately 1% of ballots being spoiled no matter what ratio you use: