From 39d0adbd0d22512f537d4df7f1de96d45ecc81df Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Fri, 8 Jan 2021 19:16:56 +1100 Subject: [PATCH] Implement Meek STV --- README.md | 1 + docs/options.md | 4 +- html/index.html | 2 + html/index.js | 19 ++++ html/worker.js | 46 ++++++--- pyRCV2/cli/stv.py | 5 +- pyRCV2/method/base_stv.py | 1 + pyRCV2/method/meek.py | 207 ++++++++++++++++++++++++++++++++++++++ pyRCV2/model.py | 8 ++ pyRCV2/transcrypt.py | 2 +- 10 files changed, 277 insertions(+), 18 deletions(-) create mode 100644 pyRCV2/method/meek.py diff --git a/README.md b/README.md index 13bc52b..6fa9837 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ pyRCV2 accepts data in the [BLT file format](http://www.dia.govt.nz/diawebsite.N * weighted inclusive Gregory STV (e.g. [Scottish STV](https://www.opavote.com/methods/scottish-stv-rules)) * unweighted inclusive Gregory STV (e.g. [Australian Senate STV](https://www.legislation.gov.au/Details/C2020C00400/Html/Text#_Toc59107700)) * exclusive Gregory STV (e.g. [PRSA 1977](https://www.prsa.org.au/rule1977.htm) and [ERS97](https://www.electoral-reform.org.uk/latest-news-and-research/publications/how-to-conduct-an-election-by-the-single-transferable-vote-3rd-edition/)) +* [Meek STV](http://www.dia.govt.nz/diawebsite.NSF/Files/meekm/%24file/meekm.pdf) * [Wright STV](https://www.aph.gov.au/Parliamentary_Business/Committees/House_of_Representatives_Committees?url=em/elect07/subs/sub051.1.pdf) pyRCV2 is highly customisable, including options for: diff --git a/docs/options.md b/docs/options.md index ea82099..0bb394e 100644 --- a/docs/options.md +++ b/docs/options.md @@ -6,6 +6,7 @@ The preset dropdown allows you to choose from a hardcoded list of preloaded STV * [Scottish STV](https://www.opavote.com/methods/scottish-stv-rules) * [Australian Senate STV](https://www.legislation.gov.au/Details/C2020C00400/Html/Text#_Toc59107700) +* [Meek STV](http://www.dia.govt.nz/diawebsite.NSF/Files/meekm/%24file/meekm.pdf) * [Wright STV](https://www.aph.gov.au/Parliamentary_Business/Committees/House_of_Representatives_Committees?url=em/elect07/subs/sub051.1.pdf) * [PRSA 1977](https://www.prsa.org.au/rule1977.htm) – with counting performed to the thousandth of a vote, and results reported in raw votes to 3 decimal places * [ERS97](https://www.electoral-reform.org.uk/latest-news-and-research/publications/how-to-conduct-an-election-by-the-single-transferable-vote-3rd-edition/) @@ -91,9 +92,10 @@ Some STV counting rules provide, for example, that ‘no surplus shall be transf ## Method (-m/--method) -This dropdown allows you to select how ballots are transferred during surplus transfers or exclusions. The recommended method is: +This dropdown allows you to select how ballots are transferred during surplus transfers or exclusions. The recommended methods are: * *Weighted inclusive Gregory* (default): During surplus transfers, all applicable ballot papers of the transferring candidate are examined. Transfers are weighted according to the weights of the ballot papers. +* *Meek STV*: Transfers are computed as described at . Other methods are supported, but not recommended: diff --git a/html/index.html b/html/index.html index 11d7802..4d13131 100644 --- a/html/index.html +++ b/html/index.html @@ -33,6 +33,7 @@ + @@ -86,6 +87,7 @@ +