Open
Conversation
peterrrock2
requested changes
Mar 13, 2026
Collaborator
peterrrock2
left a comment
There was a problem hiding this comment.
General comments
- Prefer
snake_casetocamelCasefor variables - Add tests (mimic test_rating.py)
MVP
- Add tests for this election method and update the doc strings
Collaborator
There was a problem hiding this comment.
Let's make the strong assumption that by the time a ScoreProfile is passed to this election method, the profile only contains scores and not credits.
- Provide meaningful errors when a profile has a value over budget
- Provide a cleaning function that converts a ScoreProfile that has credits to one that only has vote counts.
- Provide a cleaning function to remove illegal ballots (ballots over budget)
| converts those credits into votes. | ||
| """ | ||
| profile_copy = copy.deepcopy(profile) | ||
| for b in profile_copy.ballots: |
Collaborator
There was a problem hiding this comment.
Let's change this to loop over the dataframe
Collaborator
|
@spoole626 are you looking to get this merged in now or do you still want to work on this branch on your fork? |
I did the necessary changes for quadratic.py (changed variable name to snake case, added appropriate description for helper function, made sure it satisfied typecheck). For test_quadratic.py, it tests that Quadratic can run with credits and votes as scores (with single and multi-winner cases), it can do tiebreaks, and appropriate ValueErrors rise when needed.
fc71585 to
77da3f1
Compare
Collaborator
|
Note: I did a little cleanup on this PR to make sure it lined up with the target branch |
Collaborator
|
@spoole626 just checking in on the status of this. Let me know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implemented Quadratic voting (I'll add more descriptions later).