v1.1.0
Votekit 1.1.0 features a number of important functional and syntactical changes to the core Ballot, PreferenceProfile, and ElectionState objects. It also includes changes to ballot generation methods to output the correct number of ballots and allow for user-defined block names in the CambridgeSampler class. This release marks an overhaul to the library's documentation, and the addition of section explaining the social choice theory that underpins Votekit's functionality.
Key Changes
- Method names for
ElectionState
methods - Caches for the results of
run_election()
Ballot
objects made immutable, using Pydantic dataclass- Parameter names for
CambridgeSampler
BallotGraph
now always displays vote totals for a ballotElectionState
now prints the current round whenever printingload_blt
becameload_scottish
plot_summary_stats
always displays candidates in order inputtedPreferenceProfile
data frame now has Percent column, removed the Weight Share columnBallot
object can take floats and integers as weightsBallot
attributevoter
changed tovoter_set
Additions
- Added
to_dict()
,to_json()
functions forElectionState
- Scores attribute to
ElectionState
_rename_blocs
method toCambridgeSampler
to rename blocs to historical names.- Added
reset
andrun_to_step
methods toElection
class sort_by_weight
parameter tohead
andtail
methods ofPreferenceProfile
received_votes
parameter toget_candidates
method ofPreferenceProfile
__str__
method forBallot
Bug Fixes
- Multiple winners correctly ordered based off previous round's vote totals
CambridgeSampler
correctly computes the frequency of opposing bloc ballotsPreferenceProfile
no longer rounds all weights to integer when printing
Special thanks to Chris Donnay (@cdonnay) who made significant contributions to this release and is responsible for the improved tutorials and social choice theory sections of the documentation!