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

Ballot graph #99

Closed cdonnay closed 11 months ago

cdonnay commented 11 months ago

Sorry for the length and number of changes here, but I was finding the BallotGraph object to not really be working as intended. High level summary of changes:

  1. Change complete parameter to allow_partial in __init__. If allow_partial is True, BallotGraph constructs all possible ballot types. If False, it only generates full linear orderings.
  2. Add show_cast parameter to draw. This only displays nodes of the graph that have the cast attribute equal to True.
  3. Added/replaced necessary test functions.
  4. Changed node_data to node_weights since that is the only kind of data it was storing.

@jamesturk @drdeford @jgibson517 @jennjwang @ziglaser

cdonnay commented 11 months ago

Fixed an error with the show_cast argument so that the label_cands method only generates labels for cast ballots.

cdonnay commented 11 months ago

Closing this PR to start a new one with cleaner code.