Extract a subgraph containing the specified nodes and their connecting edges.
(self, qualified_names: list[str])
| 815 | } |
| 816 | |
| 817 | def get_subgraph(self, qualified_names: list[str]) -> dict[str, Any]: |
| 818 | """Extract a subgraph containing the specified nodes and their connecting edges.""" |
| 819 | nodes = [] |
| 820 | for qn in qualified_names: |
| 821 | node = self.get_node(qn) |
| 822 | if node: |
| 823 | nodes.append(node) |
| 824 | |
| 825 | edges = [] |
| 826 | qn_set = set(qualified_names) |
| 827 | for qn in qualified_names: |
| 828 | for e in self.get_edges_by_source(qn): |
| 829 | if e.target_qualified in qn_set: |
| 830 | edges.append(e) |
| 831 | |
| 832 | return {"nodes": nodes, "edges": edges} |
| 833 | |
| 834 | def get_stats(self) -> GraphStats: |
| 835 | """Return aggregate statistics about the graph.""" |
nothing calls this directly
no test coverage detected