mggg / VoteKit

A Swiss Army Knife for computational social choice research
https://votekit.readthedocs.io/en/latest/
MIT License
10 stars 12 forks source link

Some post tutorial updates #119

Closed cdonnay closed 8 months ago

cdonnay commented 8 months ago
  1. Change the way the condense_ballots() method works in profiles. Rather than altering the original profile, it returns a new profile. This gives users the option to preserve the original profile.
  2. Add an IRV election class, which is just a wrapper for STV with 1 seat.
  3. Add default option to Borda election class, so users do not have to input a score vector if they want to use the traditional Borda vector.
  4. Alter STV class so that the remaining candidates are always listed in order of current first place votes.
  5. Add print statement to BallotGraph so that when you draw the graph without labels, it prints a dictionary of candidate labels for you.
  6. Add several methods to PairwiseComparisonGraph. 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 and get_condorcet_cycles.
  7. Fixed an error in the PreferenceProfile tail method.
  8. Added optional to_float method to first_place_votes if users want to see them as floats instead of Fractions.

@jamesturk @drdeford @jgibson517 @jennjwang @ziglaser

I will add these to the change log only once the PR has been merged.

cdonnay commented 8 months ago

Further edits:

  1. Fixed error in STV class where if two candidates were elected simultaneously, the fractional transfer would occur twice.
  2. Added a tie string to the printing of ElectionState so users can see if candidates were tied when elected.
cdonnay commented 8 months ago

@jamesturk thanks for the edits!

I'm currently running