-
Notifications
You must be signed in to change notification settings - Fork 5
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
STAR_Test.py needs more cases #9
Comments
Thank you Mike. This is long overdue on my end. |
(I started working on this with the examples I listed, by the way) |
Did we agree on file format to use for upload?
Or, for now assume the basic scenario / format: n,Allie,Billy,Candace, Dennis, Edith, Frank, Georgie, Harold |
See the existing unit test format in STAR_Test.py for an example. The code doesn't have any functionality for reading text files or csv yet. To add a test add another function under the STARTest class like the test_original_example function. You can change the number of winners with the optional parameter numwinners
The format might change though if you want to switch to pytest. |
These ones don't work as I would expect:
All produce the same actual result:
|
@endolith I believe according to stated tiebreakers these are all expected behaviors, since the tie in the scoring round cannot be resolved. It is a good point that, no matter how it is resolved, the same candidate will win the runoff. I suppose we could check for that case by saying if 1. there exists a candidate surely making the runoff and 2. that candidate beats all other tied in the scoring round, then we can resolve the election in their favor. |
That could be resolved with just resolving the tie randomly right? Which should be an option in the event of the true tie. But we should also try to make it clear in the output results that the tie is between 1 and 2 in the score round, and not 0, 1, and 2. |
Yes, that's what I do in my implementation, and I had listed in the comments, but I removed those comments because it seemed like you weren't doing that here. https://github.com/endolith/elsim/blob/master/tests/test_star.py#L452 |
@akdienes, I believe we had settled on just reporting true ties by default, but should we add an optional parameter for resolving them randomly? This would mimic real world implementations where its up the election host to determine in advance how ties are resolved. |
Currently we just have a basic example in our test cases. We should add more to cover all the different scenarios, ties, true ties, multiwinner, etc. See STAR_Test.py for example on how to set up the test cases. This can also help us determine if the logs that we're outputting are sufficient.
The text was updated successfully, but these errors were encountered: