Skip to content

Commit

Permalink
split support for the 'missing' report
Browse files Browse the repository at this point in the history
  • Loading branch information
thvitt committed Oct 6, 2019
1 parent 3ceeb7e commit 2d7bc3e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
8 changes: 7 additions & 1 deletion src/macrogen/graph.py
Expand Up @@ -480,7 +480,13 @@ def subgraph(self, *nodes: Node, context: bool = True, path_to: Iterable[Node] =
Returns:
The constructed subgraph
"""
central_nodes = set(nodes)
if any(isinstance(node, SplitReference) for node in self.base.nodes):
central_nodes = set()
for graph_node in self.base:
if graph_node in nodes or isinstance(graph_node, SplitReference) and graph_node.reference in nodes:
central_nodes.add(graph_node)
else:
central_nodes = set(nodes)
relevant_nodes = set(central_nodes)
if context:
for node in central_nodes:
Expand Down
3 changes: 2 additions & 1 deletion src/macrogen/report.py
Expand Up @@ -696,7 +696,8 @@ def _flatten(items: List) -> List:

def report_missing(graphs: MacrogenesisInfo):
target = config.path.report_dir
refs = {node for node in graphs.base.nodes if isinstance(node, Reference)}
refs = {node.reference if isinstance(node, SplitReference) else node
for node in graphs.base.nodes if isinstance(node, Reference)}
all_wits = {wit for wit in Witness.database.values() if isinstance(wit, Witness)}
used_wits = {wit for wit in refs if isinstance(wit, Witness)}
unknown_refs = {wit for wit in refs if isinstance(wit, UnknownRef)}
Expand Down
6 changes: 0 additions & 6 deletions src/macrogen/splitgraph.py
Expand Up @@ -38,12 +38,6 @@ def __getattr__(self, item):
def filename(self) -> Path:
return self.reference.filename


@property
def uri(self):
return self.reference.uri


def __str__(self):
return f"{self.reference} ({self.side.label})"

Expand Down

0 comments on commit 2d7bc3e

Please sign in to comment.