Skip to content

Commit

Permalink
increment version, update test
Browse files Browse the repository at this point in the history
  • Loading branch information
johnh865 committed Mar 4, 2021
1 parent 3c24297 commit ffa224c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
#
setup(
name='votesim',
version='1.0.8', # Mar 3, 2021 update
version='1.0.9', # Mar 3, 2021 update, Seq Monroe Update
# version='1.0.8', # Mar 3, 2021 update
# version='1.0.7', # Mar 2, 2021 update
# version='1.0.6', # Mar 1, 2021 update
# version='1.0.5', # Feb 26, 2021 update - fix to STAR
Expand Down
3 changes: 2 additions & 1 deletion votesim/votemethods/score.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,8 @@ def sequential_monroe(data, numwin=1, maxscore=None ):
if logger.isEnabledFor(logging.DEBUG):
new_weight = np.sum(weights[voter_locs])
logger.debug('new_weight=%.3f', new_weight)
logger.debug('residual=%.3f', new_weight - surplus_weight)
logger.debug('residual=%.3f (Should be about zero)',
new_weight - surplus_weight)
break

elif votes_exhausted <= quota:
Expand Down
23 changes: 11 additions & 12 deletions votesim/votemethods/tests/test_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,17 +200,16 @@ def test_spatial(self):

numvoters = 99
num_candidates = 20

v = spatial.Voters(seed=400,)
v.add_random(numvoters=numvoters, ndim=2, )
c = spatial.Candidates(voters=v, seed=0)
c.add_random(cnum=num_candidates, sdev=1.0)
e = spatial.Election(voters=v, candidates=c)
scores = e.ballotgen.get_honest_ballots(
etype=votesim.votemethods.SCORE
)

winners, ties, output = score.sequential_monroe(scores, numwin=6)
for ii in range(50):
v = spatial.Voters(seed=ii,)
v.add_random(numvoters=numvoters, ndim=2, )
c = spatial.Candidates(voters=v, seed=0)
c.add_random(cnum=num_candidates, sdev=1.0)
e = spatial.Election(voters=v, candidates=c)
scores = e.ballotgen.get_honest_ballots(
etype=votesim.votemethods.SCORE
)
winners, ties, output = score.sequential_monroe(scores, numwin=6)
return


Expand Down Expand Up @@ -248,7 +247,7 @@ def test_score_compare(self):


t= TestSequentialMonroe()
t.test_score_compare()
t.test_spatial()

# t = TestRRW()
# t.test_result()
Expand Down

0 comments on commit ffa224c

Please sign in to comment.