From 82e90a0e100b36b7832246a7814a4e525db4d248 Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Sat, 18 Jun 2022 02:00:17 +1000 Subject: [PATCH] Update documentation --- .gitignore | 2 ++ docs/options.md | 4 ++-- homepage/_layouts/default.html | 2 +- homepage/index.html | 40 +--------------------------------- src/stv/mod.rs | 2 +- 5 files changed, 7 insertions(+), 43 deletions(-) diff --git a/.gitignore b/.gitignore index 9599041..2f43d2c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ /html/opentally.js /html/opentally_*.wasm +/homepage/_news.html + # Jekyll /homepage/_site /homepage/.sass-cache diff --git a/docs/options.md b/docs/options.md index a33eb35..19c5c40 100644 --- a/docs/options.md +++ b/docs/options.md @@ -29,7 +29,7 @@ The preset dropdown allows you to choose from a hardcoded list of preloaded STV Exceptions: * [E1] When generating random numbers, OpenTally uses a [deterministic random number generator based on SHA-256](https://yingtongli.me/git/OpenTally/about/docs/rng.md), rather than the Wichmann–Hill(-based) algorithm. -* [E2] When breaking ties backwards, OpenTally selects the candidate who had more/fewer votes at the last stage when *any* tied candidate had more/fewer votes, rather than the method described in the legislation (when each all had unequal votes). The OpenTally developers regard the method described in the legislation as a defect. For an independent discussion, see Conway et al. +* [E2] When breaking ties backwards, OpenTally applies a recursive method rather than the method described in the legislation. The OpenTally developers regard the method described in the legislation as a defect. For an independent discussion, see Conway et al. * [E3] A tie between 2 candidates for the final vacancy will be broken backwards then at random, rather than the method described in the legislation. * [E4] Bulk exclusion is not performed, as the prescribed rules are more conservative than OpenTally's. See also the section on *Bulk exclusion* for further discussion. * [E5] The legislation is drafted such that a consistent interpretation is impossible – see Conway for a discussion. In practice, the New South Wales Electoral Commission has applied the ‘by parcel’ method of rounding subtransfers, which OpenTally follows. @@ -174,7 +174,7 @@ This dropdown allows you to select how constraints are applied. The options are: *Guard/doom* (default): -When this option is selected, OpenTally applies constraints using the Grey–Fitzgerald method. Whenever a candidate is declared elected or excluded, any candidate who must be elected to secure a conformant result is deemed *guarded*, and any candidate who must not be elected to secure a conformant result is deemed *doomed*. Any candidate who is doomed is excluded at the next opportunity. Any candidate who is guarded is prevented from being excluded. +When this option is selected, OpenTally applies constraints using the Gray–Fitzgerald method. Whenever a candidate is declared elected or excluded, any candidate who must be elected to secure a conformant result is deemed *guarded*, and any candidate who must not be elected to secure a conformant result is deemed *doomed*. Any candidate who is doomed is excluded at the next opportunity. Any candidate who is guarded is prevented from being excluded. Multiple constraints are supported using the method described by Hill ([*Voting Matters* 1998;(9):2–4](http://www.votingmatters.org.uk/ISSUE9/P1.HTM)) and Otten ([*Voting Matters* 2001;(13):4–7](http://www.votingmatters.org.uk/ISSUE13/P3.HTM)). diff --git a/homepage/_layouts/default.html b/homepage/_layouts/default.html index a8b7421..2ed6132 100644 --- a/homepage/_layouts/default.html +++ b/homepage/_layouts/default.html @@ -40,7 +40,7 @@ diff --git a/homepage/index.html b/homepage/index.html index 59e7de3..cf0eeef 100644 --- a/homepage/index.html +++ b/homepage/index.html @@ -63,45 +63,7 @@ title: "OpenTally: Advanced online election counting"
-
-
-
-
Dev Log
-
Parcels? Subparcels? Not just for STV hand counts!
-

Single transferable vote rules designed for hand-counting often contain references to ‘parcels’ (or ‘bundles’ or ‘batches’), ‘further parcels’ and sometimes even ‘subparcels’.

-

For example, consider the 4th stage of the ERS97 model election. 107 of Glazier's and Wright's ballot papers are aggregated according to…

-
- -
-
-
-
-
-
Dev Log
-
Implementing a BLT parser by hand in Rust (vs pest and combine)
-

OpenTally is open-source software which can count single transferable vote elections specified using the BLT file format.

-

Earlier this month, I replaced OpenTally's previous naive string-manipulation-based BLT parser with one using pest. A new parser was necessary to support extensions to the BLT

-
- -
-
-
-
-
-
Dev Log
-
Asyncify with vanilla JS/WebAssembly (wasm-bindgen compatible)
-

WebAssembly is a technology for executing compiled programs in the web browser at near-native speeds. However, it has a number of current limitations, including that it does not support coroutines/asynchronicity.

-

In OpenTally, WebAssembly is used to run code for counting an election. This…

-
- -
-
+ {% include_relative _news.html %}
diff --git a/src/stv/mod.rs b/src/stv/mod.rs index 20698a7..b99b894 100644 --- a/src/stv/mod.rs +++ b/src/stv/mod.rs @@ -209,7 +209,7 @@ impl STVOptions { return flags.join(" "); } - /// Validate the combination of [STVOptions] and panic if invalid + /// Validate the combination of [STVOptions] and error if invalid pub fn validate(&self) -> Result<(), STVError> { if self.surplus == SurplusMethod::Meek { if self.quota_mode != QuotaMode::DynamicByTotal { return Err(STVError::InvalidOptions("--surplus meek requires --quota-mode dynamic_by_total")); }