Skip to content

Commit

Permalink
missed an edge case in assignment checking
Browse files Browse the repository at this point in the history
  • Loading branch information
zschutzman committed Mar 14, 2019
1 parent 45861bb commit 77b6ede
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gerrychain/partition/partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ def _first_time(self, graph, assignment, updaters):

def validate_assignment(self):
node_names = set(self.graph.nodes)
if len(node_names) != sum(len(dist) for dist in self.assignment.parts.values()):
return False

assgn_names = set(name for dist in self.assignment.parts.values() for name in dist)
return node_names == assgn_names

Expand Down

0 comments on commit 77b6ede

Please sign in to comment.