v1.1.1
VoteKit 1.1.1 is a patch update aimed primarily at extending the functionality of VoteKit. More specifically, this release implements score-based voting systems, and does so without editing the ballot class. To use a score-based system, you have to decide how many points to assign to each position of the ranking. This is flexible enough to handle things like cumulative and approval voting.
This update also includes some additional functionality that was included after creating and running some tutorials on usage of the software. For recordings and copies of some of these notebooks, please see the main website for VoteKit.
Key Changes
- Change the way the
condense_ballots()
method works in profiles. Rather than altering the original profile, it returns a new profile. - Altered
STV
class so that the remaining candidates are always listed in order of current first place votes. - Added print statement to
BallotGraph
so that when you draw the graph without labels, it prints a dictionary of candidate labels for you.
Additions
- Added a
by_bloc
parameter togenerate_profile
. If True, this returns a dictionary ofPreferenceProfile
objects by bloc. Defaults to False for backwards compatibility. - Created a
Cumulative
ballot generator class. TheCumulative
class works like PL, but samples with replacement instead of without. The ranking order does not matter here, simply that candidates are listed on the ballot with multiplicity. - Created a
HighestScore
election class. This takes in a profile and a score vector, and returns the$m$ candidates with highest scores. - Created a
Cumulative
election class which is just a subclass ofHighestScore
with the score vector set to all 1s. - Wrote an
__add__
method forPreferenceProfile
that combines the ballot lists of two profiles. - Created utility functions to compute the winners of a profile given a score vector, as well as to validate a score vector (non-negative and non-increasing).
- Add an
IRV
election class, which is just a wrapper forSTV
with 1 seat. - Add default option to
Borda
election class, so users do not have to input a score vector.
Add several methods toPairwiseComparisonGraph
.- Added two boolean methods that return True if there is a condorcet winner or if there is a condorcet cycle.
- Added two get methods that return the winner or the cycles. Cached the results of
dominating_tiers
andget_condorcet_cycles
.
- Added optional
to_float
method tofirst_place_votes
if users want to see them as floats instead of Fractions.
Bug Fixes
- Fixed an error in the
PreferenceProfile
tail method.
Full Changelog: v1.1.0..v1.1.1