Skip to content

Commit

Permalink
Remove last vestiges of 'constraint' stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Sep 4, 2024
1 parent 3420777 commit dc05b76
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions pytools/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,8 +549,6 @@ def dfs(node: NodeT) -> None:
# }}}


# {{{ tag propagation graph processing

def undirected_graph_from_edges(
edges: Iterable[Tuple[NodeT, NodeT]],
) -> GraphT[NodeT]:
Expand All @@ -566,7 +564,7 @@ def undirected_graph_from_edges(

for lhs, rhs in edges:
if lhs == rhs:
raise TypeError("Found matching LHS and RHS in constraints,"
raise TypeError("Found loop in edges,"
f" LHS, RHS = {lhs}")

undirected_graph.setdefault(lhs, set()).add(rhs)
Expand All @@ -577,8 +575,8 @@ def undirected_graph_from_edges(


def get_reachable_nodes(
undirected_graph: GraphT[NodeT],
source_node: NodeT) -> FrozenSet[NodeT]:
undirected_graph: GraphT[NodeT],
source_node: NodeT) -> FrozenSet[NodeT]:
"""
Returns a :class:`frozenset` of all nodes in *undirected_graph* that are
reachable from *source_node*.
Expand All @@ -597,7 +595,5 @@ def get_reachable_nodes(

return frozenset(nodes_visited)

# }}}


# vim: foldmethod=marker

0 comments on commit dc05b76

Please sign in to comment.