Equal-Vote / starpy

Python implementation of the STAR Voting system
https://www.starvoting.org/
BSD 3-Clause "New" or "Revised" License
8 stars 4 forks source link

Fix return of index instead of name #13

Closed endolith closed 2 years ago

endolith commented 2 years ago

If candidates are tied in runoff, the tiebreaker returns an index instead of a string.

The first example I tried for the docstring returned 0:

            >>> import pandas as pd
            >>> ballots = pd.DataFrame(columns=['Allie', 'Billy', 'Candace'],
                                       data=[*2*[[5,      4,       1]],
                                             *1*[[2,      5,       0]],
                                             *3*[[0,      4,       5]],])
            >>> print(ballots)
               Allie  Billy  Candace
            0      5      4        1
            1      5      4        1
            2      2      5        0
            3      0      4        5
            4      0      4        5
            5      0      4        5
            >>> print(STAR(ballots))
            0