From 080615a9dbdef3f36e20e3f271c5b7c334489d30 Mon Sep 17 00:00:00 2001 From: napakalas Date: Fri, 24 May 2024 11:58:42 +1200 Subject: [PATCH] update edge removal criteria --- mapmaker/routing/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mapmaker/routing/__init__.py b/mapmaker/routing/__init__.py index 5564bab0..22c814d9 100644 --- a/mapmaker/routing/__init__.py +++ b/mapmaker/routing/__init__.py @@ -1307,8 +1307,8 @@ def set_direction(upstream_node): route_graph.remove_edge(p[i], p[i+1]) # removing self loop due to generalisation - for edge in nx.Graph(route_graph): - if edge[0] == edge[1] and (edge[0], edge[1]) in route_graph: + for edge in nx.Graph(route_graph).edges: + if edge[0] == edge[1] and route_graph.has_edge(edge[0], edge[1]): route_graph.remove_edge(edge[0], edge[1]) if debug: