Skip to content

Commit

Permalink
Make ReactionModelProbPolicy a bit safer
Browse files Browse the repository at this point in the history
Co-authored-by: Krzysztof Maziarz <krzysztof.maziarz@microsoft.com>
  • Loading branch information
fiberleif and kmaziarz authored Sep 14, 2023
1 parent df84065 commit fbf67b0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion syntheseus/search/node_evaluation/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,7 @@ def _get_reaction(self, node: Union[MolSetNode, AndNode], graph) -> BackwardReac
parents = list(graph.predecessors(node))
assert len(parents) == 1, "Graph must be a tree"
return graph._graph.edges[parents[0], node]["reaction"]
else:
elif isinstance(node, AndNode):
return node.reaction
else:
raise ValueError(f"ReactionModelProbPolicy does not support nodes of type {type(node)}")

0 comments on commit fbf67b0

Please sign in to comment.