Unverified Commit f01c8e29 authored by Eelke Spaak's avatar Eelke Spaak Committed by GitHub

distribution on new line in GraphViz node (#3957)

* distribution on new line in GraphViz node

* updating tests to check newline instead of space in graphviz graphs
parent bca5b88c
......@@ -147,7 +147,7 @@ class ModelGraph:
attrs['shape'] = 'box'
graph.node(var_name.replace(':', '&'),
'{var_name} ~ {distribution}'.format(var_name=var_name, distribution=distribution),
'{var_name}\n~\n{distribution}'.format(var_name=var_name, distribution=distribution),
def get_plates(self):
......@@ -188,12 +188,12 @@ class TestData(SeededTest):
g = pm.model_to_graphviz(model)
# Data node rendered correctly?
text = 'x [label="x ~ Data" shape=box style="rounded, filled"]'
text = 'x [label="x\n~\nData" shape=box style="rounded, filled"]'
assert text in g.source
# Didn't break ordinary variables?
text = 'beta [label="beta ~ Normal"]'
text = 'beta [label="beta\n~\nNormal"]'
assert text in g.source
text = 'obs [label="obs ~ Normal" style=filled]'
text = 'obs [label="obs\n~\nNormal" style=filled]'
assert text in g.source
def test_explicit_coords(self):
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment