Beispiel #1
0
def test_get_networkx_graph():
    c1 = BaseComponent("c1")
    c2 = BaseComponent("c2")
    c3 = BaseComponent("c3")
    c2.parent_component_list = [c1]
    c2.child_component_list = [c3]
    product = BaseProduct([c3, c2, c1])
    product.get_networkx_graph()
Beispiel #2
0
def test_get_node_and_edge_trace_for_plotly_network():
    c1 = BaseComponent("c1")
    c2 = BaseComponent("c2")
    c3 = BaseComponent("c3")
    c2.parent_component_list = [c1]
    c2.child_component_list = [c3]
    product = BaseProduct([c3, c2, c1])
    node_trace, edge_trace = product.get_node_and_edge_trace_for_plotly_network(
    )
Beispiel #3
0
def test_draw_plotly_network():
    c1 = BaseComponent("c1")
    c2 = BaseComponent("c2")
    c3 = BaseComponent("c3")
    c2.parent_component_list = [c1]
    c2.child_component_list = [c3]
    product = BaseProduct([c3, c2, c1])
    product.draw_plotly_network(save_fig_path="test.png")
    if os.path.exists("test.png"):
        os.remove("test.png")
Beispiel #4
0
def test_draw_plotly_network(tmpdir):
    """test_draw_plotly_network."""
    c1 = BaseComponent("c1")
    c2 = BaseComponent("c2")
    c3 = BaseComponent("c3")
    c2.parent_component_list = [c1]
    c2.child_component_list = [c3]
    product = BaseProduct([c3, c2, c1])
    for ext in ["png", "html", "json"]:
        save_fig_path = os.path.join(str(tmpdir), "test." + ext)
        product.draw_plotly_network(save_fig_path=save_fig_path)