From 8c08ddce6ce3dcb3e1cc30cea82fa896eec1d553 Mon Sep 17 00:00:00 2001 From: "Afshin T. Darian" Date: Thu, 28 Mar 2024 18:52:32 +0000 Subject: [PATCH] Update docs to link to STeVe script --- .gitignore | 3 +++ elections/README.md | 4 ++-- elections/process-votes.py | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 86cf0a23..dead4c0c 100644 --- a/.gitignore +++ b/.gitignore @@ -63,3 +63,6 @@ target/ # Docs _build + +# macOS +.DS_Store diff --git a/elections/README.md b/elections/README.md index caca0992..7b44a700 100644 --- a/elections/README.md +++ b/elections/README.md @@ -2,7 +2,7 @@ The script in this directory converts a comma-separated value (CSV) file from a Jupyter Executive Council election into an `.ini` file and a `.txt` -file for use with the Apache STeVe script `stv_tool.py`. After running +file for use with the Apache STeVe script `stv_tool.py`. After running this latter script, which is stored in the [apache/steve project](https://github.com/apache/steve), you will determine which candidates have won. @@ -82,7 +82,7 @@ slate would have their vote represented as `abc`. From the directory where you have `votes.csv`, run `process-votes.py`. This script produces `board_nominations.ini` and `votedata.txt` for use -with the Apache STeVe tabulation script. Run this script, passing the +with the [Apache STeVe tabulation script (`stv_tool.py`)](https://github.com/apache/steve/blob/trunk/monitoring/stv_tool.py). Run this script, passing the number of seats to elect with the `-s` parameter. In the example below, the tabulation script will select two winners. You can get more verbose output using the `-v` parameter. diff --git a/elections/process-votes.py b/elections/process-votes.py index 1e90b270..d933394a 100644 --- a/elections/process-votes.py +++ b/elections/process-votes.py @@ -32,9 +32,9 @@ candidate_alphas = [' '] * len(candidate_priorities) for idx, c in enumerate(candidate_priorities): - if (re.search('\d', c)): + if (re.search(r'\d', c)): candidate_alphas[int(c) - 1] = letters[idx] - + # This is normally to dedupe multiple votes by the same voter, # but Google Forms already does that, so we instead assume that # every vote is unique and cast at the current time