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 9170f5fd13bd317a8edc99998448fb967a50b8b7
Author: Greg Stein <[email protected]>
AuthorDate: Tue Feb 3 00:46:27 2026 -0600

    track API changes in stv_tool and vtypes.stv
---
 v3/tests/run_stv.py | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/v3/tests/run_stv.py b/v3/tests/run_stv.py
index ef623f7..09912ee 100755
--- a/v3/tests/run_stv.py
+++ b/v3/tests/run_stv.py
@@ -37,19 +37,19 @@ def main(mtgdir):
     assert os.path.exists(labelfile)
 
     labelmap = stv_tool.read_labelmap(labelfile)
-    votes = stv_tool.read_votefile(rawfile).values()
+    newformat = (len(next(iter(labelmap))) > 1)  # keys like "a" or "aa"?
+    votes = stv_tool.read_votefile(rawfile, newformat)
 
-    # Construct a label-sorted list of names from the labelmap.
-    names = [name for _, name in sorted(labelmap.items())]
+    # Rebuild the list of label-lists into a comma-separated votestring
+    # for the STV tally function.
+    votestrings = [ ','.join(v) for v in votes ]
 
     kv = {
+        'version': 1,
         'labelmap': labelmap,
         'seats': 9,
     }
-
-    # NOTE: for backwards-compat, the tally() function accepts a
-    # list of names with caller-defined sorting.
-    human, _ = steve.vtypes.stv.tally(votes, kv, names)
+    human, _ = steve.vtypes.stv.tally(votestrings, kv)
 
     # For the comparison purposes:
     print(human)

Reply via email to