Skip to content

Commit

Permalink
reproducing recursion bug from within diagrams.py in test_nested_comp…
Browse files Browse the repository at this point in the history
…osite
  • Loading branch information
eagmon committed Mar 25, 2024
1 parent cc41bb0 commit b211d27
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 43 deletions.
62 changes: 61 additions & 1 deletion bigraph_viz/diagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,65 @@ def test_plot_disconnected():
filename='multiple_disconnected')


def test_nested_composite():
core = generate_types()

nested_composite_spec = {
'store1': {
'store1.1': {
'_value': 1.1,
'_type': 'float',
},
'store1.2': {
'_value': 2,
'_type': 'integer',
},
'store1.3': {
'_value': 1.1,
'_type': 'float',
},
'process1': {
'_type': 'process',
'_inputs': {
'port1': 'float',
'port2': 'integer',
},
'_outputs': {},
'inputs': {
'port1': ['store1.1'],
'port2': ['store1.2'],
},
'outputs': {},
},
'process2': {
'_type': 'process',
'_outputs': {
'port1': 'float',
'port2': 'integer',
},
'outputs': {
'port1': ['store1.1'],
'port2': ['store1.2'],
}
},
},
'process3': {
'_type': 'process',
'_outputs': {
'port1': 'any'
},
'outputs': {
'port1': ['store1'],
}
}
}
plot_bigraph(
nested_composite_spec,
core=core,
out_dir='out',
filename='nest_composite')


if __name__ == '__main__':
# test_diagram_plot()
# test_bio_schema()
Expand All @@ -724,4 +783,5 @@ def test_plot_disconnected():
# test_nested_processes()
# test_multi_input_output()
# test_cell_hierarchy()
test_plot_disconnected()
# test_plot_disconnected()
test_nested_composite()
2 changes: 1 addition & 1 deletion notebooks/BMCA.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 11,
"id": "1af3b2fe",
"metadata": {},
"outputs": [
Expand Down
Loading

0 comments on commit b211d27

Please sign in to comment.