From ab6e0426a4ba4f674a83ec87effa74dadbd3b9a7 Mon Sep 17 00:00:00 2001 From: Viktor Roytman Date: Thu, 28 Apr 2016 14:12:20 -0400 Subject: [PATCH 1/2] Use dict.get(key, default) https://github.com/SEL-Columbia/Sequencer/pull/62#discussion-diff-61441162 --- sequencer/NetworkPlan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sequencer/NetworkPlan.py b/sequencer/NetworkPlan.py index 4ef9e32..e4bdb43 100644 --- a/sequencer/NetworkPlan.py +++ b/sequencer/NetworkPlan.py @@ -22,7 +22,7 @@ class NetworkPlan(object): def __init__(self, network, metrics, **kwargs): self.priority_metric = kwargs['prioritize'] if 'prioritize' in kwargs else 'population' - self.proj = kwargs['proj'] if 'proj' in kwargs else 'utm' + self.proj = kwargs.get('proj', 'utm') # FIXME: # Remove the dependency that sequencer has on the From 0a8c26a8494d2965915c7b8a37c4200139fc6a65 Mon Sep 17 00:00:00 2001 From: Viktor Roytman Date: Thu, 28 Apr 2016 14:15:10 -0400 Subject: [PATCH 2/2] Remove integer index check superceded by 9209ba7 https://github.com/SEL-Columbia/Sequencer/pull/62#discussion_r61443860 --- sequencer/Sequencer.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/sequencer/Sequencer.py b/sequencer/Sequencer.py index acda0b1..6209c78 100644 --- a/sequencer/Sequencer.py +++ b/sequencer/Sequencer.py @@ -235,8 +235,6 @@ def _build_edge_wkt(self): # Iterate through the nodes and their parent for rank, fnode, tnode in zip(r.index, r['Sequence..Upstream.id'], r['Sequence..Vertex.id']): if fnode is not None: - if np.any(np.mod([fnode, tnode], 1) != 0): - raise Exception('Non-integral node index in results.') # Set the edge attributes with those found in sequencing self.networkplan.network.edge[fnode][tnode]['rank'] = int(rank) self.networkplan.network.edge[fnode][tnode]['distance'] = float(self.networkplan._distance(fnode, tnode))