jontingvold / pyrankvote

PyRankVote is a python library for different ranked-choice voting systems, like IRV, STV and PBV. Created in June 2019.
MIT License
52 stars 16 forks source link

Final result displays fractional values #2

Closed David1one closed 4 years ago

David1one commented 4 years ago

After printing out an election result for single transferable vote, "Final Result" sees candidates with non-integer number of ballots.

See test data: STV bug report - input.txt STV bug report - output.txt

jontingvold commented 4 years ago

This is the correct behavior.

There are many different STV implementations. This implementation uses fractional droop quota and Gregory method to handle surplus allocation. Both are causes for fractional vote counts.

jontingvold commented 4 years ago

For future viewers If someone else are reading this in the future and would like another STV/RCV implementation (for instance Haare quota, non-fractional Droop quota, Hare surplus allocation, Cincinnati, Wright, Hare-Clark, Meek or Warren), please leave a comment to let me know. If many people request this, I might consider to implement the most common variations.

When I first developed this library my intension was that it would be used in small election systems, where these implementation details would not matter much. However, I have since discovered that some people are using the library to replicate election results from previous elections where these details matter a lot.