From 8febb05ac9f27757b20c9de99f53001ee89b734d Mon Sep 17 00:00:00 2001 From: Martin Lackner Date: Fri, 31 Jan 2020 15:05:46 +0100 Subject: [PATCH] new structure --- __init__.py => apportionment/__init__.py | 0 {examples => apportionment/examples}/__init__.py | 0 {examples => apportionment/examples}/austria_examples.py | 0 {examples => apportionment/examples}/israel_examples.py | 0 {examples => apportionment/examples}/knesset.txt | 0 {examples => apportionment/examples}/nr_wahlen.txt | 0 examples/example.py => apportionment/examples/simple.py | 0 apportionment.py => apportionment/methods.py | 2 +- unittests.py => apportionment/unittests.py | 0 9 files changed, 1 insertion(+), 1 deletion(-) rename __init__.py => apportionment/__init__.py (100%) rename {examples => apportionment/examples}/__init__.py (100%) rename {examples => apportionment/examples}/austria_examples.py (100%) rename {examples => apportionment/examples}/israel_examples.py (100%) rename {examples => apportionment/examples}/knesset.txt (100%) rename {examples => apportionment/examples}/nr_wahlen.txt (100%) rename examples/example.py => apportionment/examples/simple.py (100%) rename apportionment.py => apportionment/methods.py (99%) rename unittests.py => apportionment/unittests.py (100%) diff --git a/__init__.py b/apportionment/__init__.py similarity index 100% rename from __init__.py rename to apportionment/__init__.py diff --git a/examples/__init__.py b/apportionment/examples/__init__.py similarity index 100% rename from examples/__init__.py rename to apportionment/examples/__init__.py diff --git a/examples/austria_examples.py b/apportionment/examples/austria_examples.py similarity index 100% rename from examples/austria_examples.py rename to apportionment/examples/austria_examples.py diff --git a/examples/israel_examples.py b/apportionment/examples/israel_examples.py similarity index 100% rename from examples/israel_examples.py rename to apportionment/examples/israel_examples.py diff --git a/examples/knesset.txt b/apportionment/examples/knesset.txt similarity index 100% rename from examples/knesset.txt rename to apportionment/examples/knesset.txt diff --git a/examples/nr_wahlen.txt b/apportionment/examples/nr_wahlen.txt similarity index 100% rename from examples/nr_wahlen.txt rename to apportionment/examples/nr_wahlen.txt diff --git a/examples/example.py b/apportionment/examples/simple.py similarity index 100% rename from examples/example.py rename to apportionment/examples/simple.py diff --git a/apportionment.py b/apportionment/methods.py similarity index 99% rename from apportionment.py rename to apportionment/methods.py index f8059c5..9035680 100644 --- a/apportionment.py +++ b/apportionment/methods.py @@ -119,7 +119,7 @@ def divisor(votes, seats, method, parties=string.ascii_letters, elif method in ["modified_saintelague"]: if verbose: print("\nModified Sainte Lague (Webster) method") - divisors = [1.4] + [2*i+1 for i in range(1,seats)] + divisors = [1.4] + [2*i+1 for i in range(1, seats)] elif method in ["huntington", "hill", "equalproportions"]: if verbose: print("\nHuntington-Hill method") diff --git a/unittests.py b/apportionment/unittests.py similarity index 100% rename from unittests.py rename to apportionment/unittests.py