Created
July 12, 2011 18:51
-
-
Save andrewjennings/1078680 to your computer and use it in GitHub Desktop.
Add options to Contiguity calculators
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: calculators.py | |
=================================================================== | |
--- calculators.py (revision 1396) | |
+++ calculators.py (working copy) | |
@@ -788,6 +788,8 @@ | |
count = 0 | |
for district in districts: | |
+ if district.geom.empty: | |
+ continue | |
if len(district.geom) == 1: | |
count += 1 | |
else: | |
@@ -887,6 +889,7 @@ | |
districts = plan.get_districts_at_version(version, include_geom=False) | |
calc = Contiguity() | |
+ calc.arg_dict = self.arg_dict | |
calc.compute(**kwargs) | |
self.result = { 'value': len(districts) == calc.result } | |
@@ -919,6 +922,7 @@ | |
districts = plan.get_districts_at_version(version, include_geom=False) | |
calc = Contiguity() | |
+ calc.arg_dict = self.arg_dict | |
calc.compute(**kwargs) | |
count = len(districts) - calc.result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment