Skip to content

Commit

Permalink
Store dead end links for inspection
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Moss committed Jan 25, 2024
1 parent fae638f commit f28fad1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions aequilibrae/paths/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ def __init__(self, logger=None):

self.g_link_crosswalk = np.array([]) # 4 a link ID in the BIG graph, a corresponding link in the compressed 1

self.dead_end_links = np.array([])

# Randomly generate a unique Graph ID randomly
self._id = uuid.uuid4().hex

Expand Down
6 changes: 3 additions & 3 deletions aequilibrae/paths/graph_building.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,10 @@ def build_compressed_graph(graph):
burnt_links,
)

graph.dead_end_links = graph.graph.link_id.values[burnt_links] # Perhaps filter to unique link_ids? There'll be duplicates in here
graph.dead_end_links = graph.graph.link_id.values[burnt_links >= 0] # Perhaps filter to unique link_ids? There'll be duplicates in here
df = pd.DataFrame(graph.network, copy=True)
if links_to_remove.shape[0]:
df = df[~df.link_id.isin(links_to_remove)]
if graph.dead_end_links.shape[0]:
df = df[~df.link_id.isin(graph.dead_end_links)]

# Build link index
link_id_max = df.link_id.max()
Expand Down

0 comments on commit f28fad1

Please sign in to comment.