You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@steve.apache.org by gs...@apache.org on 2026/03/04 04:33:24 UTC
(steve) 01/02: expand result details
This is an automated email from the ASF dual-hosted git repository.
gstein pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/steve.git
commit 6b17ab25ead6638b001c03c2c9c1debc13a29c72
Author: Greg Stein <gs...@gmail.com>
AuthorDate: Tue Mar 3 21:47:19 2026 -0600
expand result details
---
v3/steve/vtypes/stv.py | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/v3/steve/vtypes/stv.py b/v3/steve/vtypes/stv.py
index af79c4a..a225594 100644
--- a/v3/steve/vtypes/stv.py
+++ b/v3/steve/vtypes/stv.py
@@ -52,6 +52,7 @@ def tally(votestrings, kv):
# kv['labelmap'] should be: LABEL: NAME
# for example: { 'a': 'John Doe', }
labelmap = kv['labelmap']
+ revmap = { v: k for k, v in labelmap.items() }
seats = kv['seats']
@@ -71,6 +72,13 @@ def tally(votestrings, kv):
for c in results.l
)
data = {
- 'raw': results,
+ # LABEL: ELECTED-BOOL
+ 'candidates': { revmap[cand.name]: (cand.status == stv_tool.ELECTED)
+ for cand in results.l },
+
+ # Carry the input configuration and votestrings into the result.
+ 'labelmap': labelmap,
+ 'seats': seats,
+ 'votestrings': [ vs for vs in votestrings if vs ], # Eliminate empty
}
return human, data