black formatting

master
Martin Lackner 2022-02-16 17:41:55 +01:00
rodzic d6ad9ef573
commit b618119210
3 zmienionych plików z 3 dodań i 14 usunięć

Wyświetl plik

@ -43,7 +43,6 @@ jobs:
- name: Test with pytest - name: Test with pytest
run: | run: |
# note that some tests are skipped because Gurobi is not available on Github
coverage run --source=. -m pytest -v --tb=long -m unittests.py coverage run --source=. -m pytest -v --tb=long -m unittests.py
- name: Generate coverage report - name: Generate coverage report

Wyświetl plik

@ -10,18 +10,11 @@ parties = 5
seats = 20 seats = 20
methods = ["quota", "largest_remainder", "dhondt", "saintelague", "adams"] methods = ["quota", "largest_remainder", "dhondt", "saintelague", "adams"]
for iterations, votes in enumerate(combinations(range(1, maxvoters + 1), parties)):
iterator = combinations(range(1, maxvoters + 1), parties)
for iterations, votes in enumerate(iterator):
apportionments = set() apportionments = set()
for method in methods: for method in methods:
apportionments.add( apportionments.add(tuple(app.compute(method, votes, seats, verbose=False)))
tuple(
app.compute(method, votes, seats, verbose=False)
)
)
if len(apportionments) == len(methods): if len(apportionments) == len(methods):
break break
@ -33,6 +26,4 @@ print("votes = {}".format(votes))
print("found in {} iterations\n\n".format(iterations)) print("found in {} iterations\n\n".format(iterations))
for method in methods: for method in methods:
print( print("{:>20s}: {}".format(method, app.compute(method, votes, seats, verbose=False)))
"{:>20s}: {}".format(method, app.compute(method, votes, seats, verbose=False))
)

Wyświetl plik

@ -100,4 +100,3 @@ setuptools.setup(
] ]
}, },
) )