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

POC: Record vote transfers in RoundResults #21

Closed chrisroat closed 1 year ago

chrisroat commented 2 years ago

This change writes information about vote transfers that happen into each RoundResult.

The transfers need to happen after the get_results() call, and I was not able to find a clean way to do this fully within the ElectionManager. The method implemented is a little janky as the logic happens within the voting algorithms, but is pretty simple.

If this seems useful to you, I can write some tests before merging. Then we could iterate on potential re-implementations before submission.

I could also contribute some code to take a results object and produce data in a format that can be used to make a plotly Sankey diagram.