Skip to content

Commit

Permalink
Imrpvoe commenting
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobson committed Apr 25, 2024
1 parent 5ff9766 commit 9cf9f91
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions swmmanywhere/graph_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ def __call__(self,
allowable links are specified in the `omit_edges` attribute of the
topology_derivation parameter. There two cases handled:
1. The `highway` property of the edge. In osmnx, `highway` is a category
that contains the road type, e.g., motorway, trunk, residential. If
`omit_edges` contains a value that is a category under `highway`, the
edge is removed.
that contains the road type, e.g., motorway, trunk, primary. If the
edge contains a value in the `highway` property that is in `omit_edges`,
the edge is removed.
2. Any other properties of the edge that are in `omit_edges`. If the
property is not null in the edge data, the edge is removed. e.g.,
if `bridge` is in `omit_edges` and the `bridge` entry of the edge
Expand Down
4 changes: 4 additions & 0 deletions tests/test_graph_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,11 @@ def test_remove_non_pipe_allowable_links():
G = load_graph(Path(__file__).parent / 'test_data' / 'street_graph.json')
# Ensure some invalid paths
topology_params = parameters.TopologyDerivation(omit_edges = ['primary', 'bridge'])

# Test that an edge has a non-None 'bridge' entry
assert len(set([d.get('bridge',None) for u,v,d in G.edges(data=True)])) > 1

# Test that an edge has a 'primary' entry under highway
assert 'primary' in get_edge_types(G)

G_ = gu.remove_non_pipe_allowable_links(G, topology_params)
Expand Down

0 comments on commit 9cf9f91

Please sign in to comment.