Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#803 make visualise fail only raise logger error #810

Merged
merged 1 commit into from
Feb 12, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions pybamm/expression_tree/symbol.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,13 @@ def visualise(self, filename):

new_node, counter = self.relabel_tree(self, 0)

DotExporter(
new_node, nodeattrfunc=lambda node: 'label="{}"'.format(node.label)
).to_picture(filename)
try:
DotExporter(
new_node, nodeattrfunc=lambda node: 'label="{}"'.format(node.label)
).to_picture(filename)
except FileNotFoundError:
# raise error but only through logger so that test passes
pybamm.logger.error("Please install graphviz>=2.42.2 to use dot exporter")

def relabel_tree(self, symbol, counter):
""" Finds all children of a symbol and assigns them a new id so that they can be
Expand Down