Skip to content

Commit c5eb80e

Browse files
authored
Merge branch 'main' into fs/jquinn
2 parents bcb40a1 + a956e26 commit c5eb80e

18 files changed

+205
-405
lines changed

.github/FUNDING.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# These are supported funding model platforms
2+
3+
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
13+
custom: ['https://electionscience.org/donate']

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
These are some methods for running VSE (Voter Satisfaction Efficiency)
66
simulations for various voting systems.
77

8-
See [Voter Satisfaction Efficiency FAQ](http://electionscience.github.io/vse-sim/VSE/) for an explanation of the methods and results.
9-
To reproduce the figures in the paper:
8+
See [Voter Satisfaction Efficiency FAQ](http://electionscience.github.io/vse-sim/) for an explanation of the methods and results.
109

1110
# Installing the code
1211
Requirements: python3, scipy, pydoc

dataClasses.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def winnerSet(cls, ballots, numWinners=1):
5656
def honBallot(cls, utils, **kw):
5757
"""Takes utilities and returns an honest ballot
5858
"""
59-
raise NotImplementedError("{} needs honBallot".format(cls))
59+
raise NotImplementedError(f"{cls} needs honBallot")
6060

6161
@classmethod
6262
def vaBallot(cls, utils, electabilities, **kw):
@@ -152,7 +152,7 @@ def winner(results):
152152
>>> 2 < Method().winner([1,2,1,3,3,3,2,1,2]) < 6
153153
True
154154
"""
155-
winScore = max([result for result in results if isnum(result)])
155+
winScore = max(result for result in results if isnum(result))
156156
winners = [cand for (cand, score) in enumerate(results) if score==winScore]
157157
#return random.choice(winners)
158158
return winners[0] #made it deterministic to prevent nondeterministic behaviors in useful functions
@@ -198,6 +198,7 @@ def stratTarget2(places):
198198
@staticmethod
199199
def stratTarget3(places):
200200
((frontId,frontResult), (targId, targResult)) = places[0:3:2]
201+
201202
return (frontId, frontResult, targId, targResult)
202203

203204
stratTargetFor = stratTarget2
@@ -247,8 +248,9 @@ def rememberBallot(fun):
247248
"""
248249
def getAndRemember(cls, voter, tally=None):
249250
ballot = fun(cls, voter)
250-
setattr(voter, cls.__name__ + "_" + fun.__name__[:-6], ballot) #leave off the "...Ballot"
251+
setattr(voter, f"{cls.__name__}_{fun.__name__[:-6]}", ballot)
251252
return ballot
253+
252254
getAndRemember.__name__ = fun.__name__
253255
getAndRemember.allTallyKeys = lambda:[]
254256
return getAndRemember
@@ -263,9 +265,10 @@ def getAndRemember(cls, voter, tally=None):
263265
ballots = fun(cls, voter)
264266
for bType, ballot in ballots.items():
265267

266-
setattr(voter, cls.__name__ + "_" + bType, ballot)
268+
setattr(voter, f"{cls.__name__}_{bType}", ballot)
267269

268270
return ballots[fun.__name__[:-6]] #leave off the "...Ballot"
271+
269272
getAndRemember.__name__ = fun.__name__
270273
getAndRemember.allTallyKeys = lambda:[]
271274
return getAndRemember

docs/404.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/VSE.md

Lines changed: 0 additions & 140 deletions
This file was deleted.

docs/_config copy.yml

Lines changed: 0 additions & 86 deletions
This file was deleted.

docs/about.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

docs/dummy.html

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/index.html

Lines changed: 0 additions & 18 deletions
This file was deleted.

docs/prettypic.jpg

-488 KB
Binary file not shown.

0 commit comments

Comments
 (0)