kopia lustrzana https://github.com/martinlackner/apportionment
make fractions=False default
rodzic
59559b40b8
commit
0a1a742b72
|
@ -25,7 +25,7 @@ def compute(
|
||||||
method,
|
method,
|
||||||
votes,
|
votes,
|
||||||
seats,
|
seats,
|
||||||
fractions=True,
|
fractions=False,
|
||||||
parties=string.ascii_letters,
|
parties=string.ascii_letters,
|
||||||
threshold=None,
|
threshold=None,
|
||||||
tiesallowed=True,
|
tiesallowed=True,
|
||||||
|
@ -117,7 +117,7 @@ def within_quota(votes, representatives, parties=string.ascii_letters, verbose=T
|
||||||
|
|
||||||
# Largest remainder method (Hamilton method)
|
# Largest remainder method (Hamilton method)
|
||||||
def largest_remainder(
|
def largest_remainder(
|
||||||
votes, seats, fractions=True, parties=string.ascii_letters, tiesallowed=True, verbose=True
|
votes, seats, fractions=False, parties=string.ascii_letters, tiesallowed=True, verbose=True
|
||||||
):
|
):
|
||||||
# votes = np.array(votes)
|
# votes = np.array(votes)
|
||||||
if verbose:
|
if verbose:
|
||||||
|
@ -167,7 +167,7 @@ def largest_remainder(
|
||||||
|
|
||||||
# Divisor methods
|
# Divisor methods
|
||||||
def divisor(
|
def divisor(
|
||||||
votes, seats, method, fractions=True, parties=string.ascii_letters, tiesallowed=True, verbose=True
|
votes, seats, method, fractions=False, parties=string.ascii_letters, tiesallowed=True, verbose=True
|
||||||
):
|
):
|
||||||
votes = np.array(votes)
|
votes = np.array(votes)
|
||||||
representatives = np.zeros(len(votes), dtype=int)
|
representatives = np.zeros(len(votes), dtype=int)
|
||||||
|
@ -296,7 +296,7 @@ def __divzero_fewerseatsthanparties(votes, seats, parties, tiesallowed, verbose)
|
||||||
return representatives
|
return representatives
|
||||||
|
|
||||||
|
|
||||||
def quota(votes, seats, fractions=True, parties=string.ascii_letters, tiesallowed=True, verbose=True):
|
def quota(votes, seats, fractions=False, parties=string.ascii_letters, tiesallowed=True, verbose=True):
|
||||||
"""The quota method
|
"""The quota method
|
||||||
see Balinski, M. L., & Young, H. P. (1975).
|
see Balinski, M. L., & Young, H. P. (1975).
|
||||||
The quota method of apportionment.
|
The quota method of apportionment.
|
||||||
|
|
Ładowanie…
Reference in New Issue