Skip to content

Commit

Permalink
Fix: Conflict edges would disappear from split model
Browse files Browse the repository at this point in the history
  • Loading branch information
thvitt committed Jul 20, 2020
1 parent 4fee5ad commit 148b415
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/macrogen/graph.py
Expand Up @@ -634,6 +634,8 @@ def add_path(self, graph: nx.MultiDiGraph, source: Node, target: Node, weight='i
except nx.NetworkXException as e:
if must_exist:
raise e
else:
logger.debug('No path from %s to %s', source, target)

def subgraph(self, *nodes: Node, context: bool = True, path_to: Iterable[Node] = {}, abs_dates: bool = True,
path_from: Iterable[Node] = {}, paths: Iterable[Node] = {}, paths_without_timeline: bool = False,
Expand Down Expand Up @@ -723,8 +725,8 @@ def subgraph(self, *nodes: Node, context: bool = True, path_to: Iterable[Node] =
if paths_between_nodes:
for other in central_nodes:
if other != node:
self.add_path(subgraph, node, other, edges_from=path_base)
self.add_path(subgraph, other, node, edges_from=path_base)
self.add_path(subgraph, node, other, edges_from=self.base)
self.add_path(subgraph, other, node, edges_from=self.base)

if direct_assertions:
subgraph.add_edges_from(self.base.in_edges(node, keys=True, data=True))
Expand Down

0 comments on commit 148b415

Please sign in to comment.