diff --git a/src/topupopt/data/gis/calculate.py b/src/topupopt/data/gis/calculate.py index ad236f7155e17d3b73fda4e3b8dc87079026c815..03586a290ef4c414c6c60f9da7b41b5244958849 100644 --- a/src/topupopt/data/gis/calculate.py +++ b/src/topupopt/data/gis/calculate.py @@ -341,4 +341,4 @@ def count_ocurrences(gdf: GeoDataFrame, return count_dict # ***************************************************************************** -# ***************************************************************************** \ No newline at end of file +# ***************************************************************************** diff --git a/src/topupopt/data/gis/identify.py b/src/topupopt/data/gis/identify.py index 1449bac2ec09331a9c914c80dd846e3e8fb7cd48..33ccd46ce1eca3398895d557224b2339108489eb 100644 --- a/src/topupopt/data/gis/identify.py +++ b/src/topupopt/data/gis/identify.py @@ -1030,7 +1030,6 @@ def is_path_straight(network: nx.MultiDiGraph, # confirm that it is a path if not is_node_path(network, path, consider_reversed_edges): return False - # a straight path requires at least two nodes path_length = len(path) if path_length == 2: @@ -1161,7 +1160,6 @@ def find_simplifiable_paths(network: nx.MultiDiGraph, if consider_reversed_edges and include_both_directions: # directions do not matter: list_paths.append(new_sequence[::-1]) - # update the list of intermediate nodes already on paths list_nodes_joined.update(set(new_sequence[1:-1])) @@ -1308,7 +1306,7 @@ def _find_path_direction_sensitive( ) # cycles have to be detected on the first try if len(path) >= 3 and path[0] == path[-1]: - # it is a cycle: no need to seedgeh backwards + # it is a cycle: no need to search backwards return path # find the backward path segment return find_path_backward( @@ -1733,4 +1731,4 @@ def identify_edge_closest_to_node( return nearest_edge_keys, projected_network # ***************************************************************************** -# ***************************************************************************** \ No newline at end of file +# ***************************************************************************** diff --git a/src/topupopt/data/gis/modify.py b/src/topupopt/data/gis/modify.py index 97990b5ae4f26491df72bc19dc5b583ad68c7155..4bb3c583504fefabd25a0a83346b682be79e2888 100644 --- a/src/topupopt/data/gis/modify.py +++ b/src/topupopt/data/gis/modify.py @@ -378,7 +378,6 @@ def replace_path( edge_length = 0 for node_pair_index in range(len(path)-1): - # get one edge for this node pair edge_key = list(gis_iden.get_edges_between_two_nodes( network, @@ -388,8 +387,7 @@ def replace_path( edge_key = sorted( (network.edges[_key][osm.KEY_OSMNX_LENGTH], _key) for _key in edge_key - )[0][1] - + )[0][1] if osm.KEY_OSMNX_GEOMETRY in network.edges[edge_key]: # geometry exists: possibly a composite geometry # check if the geometry is consistent with the edge declaration @@ -1388,4 +1386,4 @@ def create_reverse_edges( return edges_created # ***************************************************************************** -# ***************************************************************************** \ No newline at end of file +# ***************************************************************************** diff --git a/src/topupopt/data/gis/utils.py b/src/topupopt/data/gis/utils.py index bd64e2e8db349187a1043c4a711314eaa1f7dfc3..3ad38ee9f8ce5a0eeec56971a8ff7de815cfe50e 100644 --- a/src/topupopt/data/gis/utils.py +++ b/src/topupopt/data/gis/utils.py @@ -1024,7 +1024,6 @@ def identify_building_entrance_edges( # otherwise, the edge is nameless but may not lead to the right street # get adjacent/neighbouring edges - other_edges = gis_iden.get_edges_involving_node( network=network, node_key=closest_edge_key[0], @@ -1214,9 +1213,7 @@ def convert_edge_path(network: MultiDiGraph, # path is a sequence of edge keys: convert to node path if allow_reversed_edges: - # reverse edges are allowed - # drop self-loops, if any edge_path = [ edge_key @@ -1261,4 +1258,4 @@ def convert_edge_path(network: MultiDiGraph, return node_path # ***************************************************************************** -# ***************************************************************************** \ No newline at end of file +# ***************************************************************************** diff --git a/tests/test_gis_identify.py b/tests/test_gis_identify.py index 0486809bef0c5217528820c6d2707b4c9cc8b0aa..1d62f7c0df27e95ed7068fa773ce1b7284ae7122 100644 --- a/tests/test_gis_identify.py +++ b/tests/test_gis_identify.py @@ -30,7 +30,7 @@ class TestGisIdentify: path: list, excluded_nodes: list, consider_reversed_edges: bool, - ignore_self_loops: bool): + ignore_self_loops: bool): # find out the unique nodes set_nodes = set(path) # at least three nodes @@ -4542,6 +4542,10 @@ class TestGisIdentify: # ************************************************************************* # ************************************************************************* +<<<<<<< HEAD +#****************************************************************************** +#****************************************************************************** +======= def test_finding_roundabouts(self): # network should be a OSM-nx formatted graph diff --git a/tests/test_gis_modify.py b/tests/test_gis_modify.py index a6b718194da09e93fd4ff11bd820ca9977bc38ee..a7bb81e1899496eb285563b0991b915fbacb1cd5 100644 --- a/tests/test_gis_modify.py +++ b/tests/test_gis_modify.py @@ -3274,4 +3274,4 @@ class TestGisModify: # TODO: test the conversion itself # ***************************************************************************** -# ***************************************************************************** \ No newline at end of file +# ***************************************************************************** diff --git a/tests/test_gis_utils.py b/tests/test_gis_utils.py index 19c60408aacc3e7a6bc171f4d7efaa55ae1ea4e1..ea06e9eb52ab81008d76e3b300231ed3576215fd 100644 --- a/tests/test_gis_utils.py +++ b/tests/test_gis_utils.py @@ -944,7 +944,6 @@ class TestGisUtils: country_code=country_code) # find out which is the closest edge - nearest_edge_keys, network = gis_iden.identify_edge_closest_to_node( network, node_keys=['P']) @@ -2143,4 +2142,4 @@ class TestGisUtils: # ************************************************************************* # ***************************************************************************** -# ***************************************************************************** \ No newline at end of file +# *****************************************************************************