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

Import Jameson Quinn's VSE Sim fork #39

Open
wants to merge 163 commits into
base: main
Choose a base branch
from

Conversation

fsargent
Copy link
Contributor

No description provided.

homunq and others added 30 commits July 19, 2021 10:45
Added low information strategies and Minimax
Wrote some of threeRoundResults, added a basic but non-rigorous pollsToProbs function, refactored low-information strats, and added a better zero-information approval voting strategy.
Switched to using threeRoundResult. Removed @rememberBallot decorators. Switched from static methods to class methods for strategy functions and results.
Implemented the binary search for determining the minimum foreground to elect the winner under strategy and ensured that all results are returned.
Added comp and diehard strategies for plurality, approval, score, and IRV. (Not yet added for STAR or Condorcet.)
Added diehard and compromise strategies for STAR and Condorcet. Improved the low info strategies for top2 methods. Increased the default polling uncertainty.
created tieFor2Estimate
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@sourcery-ai
Copy link

sourcery-ai bot commented Dec 31, 2022

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 9.94%.

Quality metrics Before After Change
Complexity 10.56 🙂 25.92 😞 15.36 👎
Method Length 65.75 🙂 84.00 🙂 18.25 👎
Working memory 7.24 🙂 10.57 😞 3.33 👎
Quality 62.04% 🙂 52.10% 🙂 -9.94% 👎
Other metrics Before After Change
Lines 1915 3200 1285
Changed files Quality Before Quality After Quality Change
dataClasses.py 78.68% ⭐ 77.21% ⭐ -1.47% 👎
methods.py 46.23% 😞 42.58% 😞 -3.65% 👎
mydecorators.py 78.84% ⭐ 79.88% ⭐ 1.04% 👍
stratFunctions.py 83.12% ⭐ 88.25% ⭐ 5.13% 👍
voterModels.py 74.14% 🙂 74.78% 🙂 0.64% 👍
vse.py 59.95% 🙂 25.94% 😞 -34.01% 👎

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
methods.py V321.stratBallotFor 52 ⛔ 469 ⛔ 5.23% ⛔ Refactor to reduce nesting. Try splitting into smaller methods
vse.py threeRoundResults 40 ⛔ 1131 ⛔ 34 ⛔ 6.01% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
methods.py makeSTARMethod 161 ⛔ 1308 ⛔ 16 ⛔ 7.41% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
methods.py makeScoreMethod 54 ⛔ 881 ⛔ 15 😞 11.05% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
methods.py V321.results 11 🙂 342 ⛔ 16 ⛔ 32.45% 😞 Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@fsargent fsargent closed this Jan 20, 2023
@fsargent fsargent reopened this Jan 20, 2023
@fsargent
Copy link
Contributor Author

@ragconsumer Can you resolve the conflicts so we can merge it?

@ragconsumer
Copy link

@ragconsumer Can you resolve the conflicts so we can merge it?

Full disclosure: I have no experience handling pull requests of any appreciable size, and I don't see any options for debugging that would prevent the disaster I anticipate when all the code is combined. The old VSE code was absolutely hideous, and I foresee problems when incorporating anything that was based on it. My approach would be to dump the old code altogether and switch to using only the code on Jameson's branch. I can try resolving the conflicts manually if you want, but I expect something to break. By the way, I'm coding a new version in Julia that should make this obsolete in a few months.

@fsargent
Copy link
Contributor Author

Honestly whatever you want to do with it sounds good to me. Happy to update the website however you see fit. You're the experts.

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

Successfully merging this pull request may close these issues.

3 participants