Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework and expand quorum calculations #4

Merged
merged 3 commits into from
Dec 5, 2023
Merged

Rework and expand quorum calculations #4

merged 3 commits into from
Dec 5, 2023

Conversation

polettif
Copy link
Owner

@polettif polettif commented Dec 5, 2023

With this PR quorum calculations in biproportional() and pukelsheim() are reworked. Instead of the parameters quorum_districts and quorum_total there's a new parameter quorum which is best used with the new quorum_all()/quorum_any() functions. This closes #3.

Instead of

biproporz(votes_matrix, seats, quorum_districts = 0.1, quorum_total = 0.05)

You'd write:

biproporz(votes_matrix, seats, quorum = quorum_all(any_district = 0.1, total = 0.05))

That way the previously implicit assumption that both quorums must be reached to be elegible for seats must be explicitly stated with quorum_all. If it's enough to reach at least one quorum (e.g. either by district or total), quorum_any should be used. If you don't want any quorum calculations to be done, the parameter can be ignored. In general, you can no longer set a quorum threshold of 0.

With this approach it should also be easier to add new quorum calculations without modifying biproportional too much. It might be a bit convoluted (a function creating a list of functions as a function argument) but quorums can be applied in a number of combinations which are difficult to cover just by parameters alone.

Other changes:

  • biprop_quorum() was removed
  • The separated functions reached_quorum_any_district() and reached_quorum_total() were added
  • reached_quorums() allows a "lower-level" access to quorum calculations
  • the quorum parameter is now in third position in pukelsheim() (instead of after new_seats_col), like biproportional()

remove biprop_quorum()
remove quorum_total, quorum_districts params
@polettif polettif merged commit 0b6ebb7 into master Dec 5, 2023
1 check passed
@polettif polettif deleted the dev/quorum branch December 5, 2023 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Quorum flexibility
1 participant