Skip to content

Commit

Permalink
Fix evidence flattening references
Browse files Browse the repository at this point in the history
  • Loading branch information
bgyori committed Nov 5, 2019
1 parent a823910 commit 9483079
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions indra/preassembler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -940,10 +940,14 @@ def flatten_evidence(stmts, collect_from=None):
def _flatten_evidence_for_stmt(stmt, collect_from):
supp_stmts = (stmt.supports if collect_from == 'supports'
else stmt.supported_by)
total_evidence = set(stmt.evidence)
evs = {ev.matches_key(): ev for ev in stmt.evidence}
total_evidence = set(evs.values())
for supp_stmt in supp_stmts:
child_evidence = _flatten_evidence_for_stmt(supp_stmt, collect_from)
total_evidence = total_evidence.union(child_evidence)
chevs = {ev.matches_key(): ev for ev in child_evidence}
for k, v in chevs.items():
evs[k] = v
total_evidence = list(evs.values())
return list(total_evidence)


Expand Down

0 comments on commit 9483079

Please sign in to comment.