Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates: PrefProfile #171

Open
cdonnay opened this issue Jan 7, 2025 · 4 comments
Open

Updates: PrefProfile #171

cdonnay opened this issue Jan 7, 2025 · 4 comments

Comments

@cdonnay
Copy link
Collaborator

cdonnay commented Jan 7, 2025

  • add a to/from csv class method, consider deprecating cvr loader
  • condense ballots forgets ids, undesirable
@cdonnay
Copy link
Collaborator Author

cdonnay commented Jan 7, 2025

from votekit import Ballot, PreferenceProfile

b1 = Ballot(ranking=(frozenset({"Chris"}), frozenset({"Peter"})), id ="top2", weight = 3)
b2 = Ballot(ranking=(frozenset({"Moon"}),frozenset({"Chris"}), frozenset({"Peter"})), weight = 6)
b3 = Ballot(ranking=(frozenset({"Chris"}), frozenset({"Peter"})), weight = 3)

profile = PreferenceProfile(ballots=(b1,b2,b3))
print(profile)

print(profile.condense_ballots())

@cdonnay
Copy link
Collaborator Author

cdonnay commented Jan 7, 2025

maybe jsonl file?

@cdonnay
Copy link
Collaborator Author

cdonnay commented Jan 14, 2025

Iterating over ballots almost always requires the weights, would you ever want to iterate without the weight?

@cdonnay
Copy link
Collaborator Author

cdonnay commented Jan 14, 2025

  • group ballots to go by weight, condense name is now reserved for an operation on individual ballots
  • show how to clean ballots appropriately, difference between portland ME and OR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant