diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index 95ca98a..1f3fd99 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -43,7 +43,6 @@ jobs: - name: Test with pytest 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 - name: Generate coverage report diff --git a/examples/alldifferent.py b/examples/alldifferent.py index 0b5747d..9995f49 100644 --- a/examples/alldifferent.py +++ b/examples/alldifferent.py @@ -10,18 +10,11 @@ parties = 5 seats = 20 methods = ["quota", "largest_remainder", "dhondt", "saintelague", "adams"] - -iterator = combinations(range(1, maxvoters + 1), parties) - -for iterations, votes in enumerate(iterator): +for iterations, votes in enumerate(combinations(range(1, maxvoters + 1), parties)): apportionments = set() for method in methods: - apportionments.add( - tuple( - app.compute(method, votes, seats, verbose=False) - ) - ) + apportionments.add(tuple(app.compute(method, votes, seats, verbose=False))) if len(apportionments) == len(methods): break @@ -33,6 +26,4 @@ print("votes = {}".format(votes)) print("found in {} iterations\n\n".format(iterations)) for method in methods: - print( - "{:>20s}: {}".format(method, app.compute(method, votes, seats, verbose=False)) - ) + print("{:>20s}: {}".format(method, app.compute(method, votes, seats, verbose=False))) diff --git a/setup.py b/setup.py index bea24cd..ff1620c 100644 --- a/setup.py +++ b/setup.py @@ -100,4 +100,3 @@ setuptools.setup( ] }, ) -