2d33217ca2c689ff8e577956325291dbe221da70,tests/data/test_stellargraph.py,,test_graph_schema,#,32

Before Change


    sg = StellarGraph()
    sg.add_nodes_from([0, 1, 2, 3], label="movie")
    sg.add_nodes_from([4, 5], label="user")
    sg.add_edges_from([(0, 4), (1, 4), (1, 5), (2, 4), (3, 5)], label="rating")

    schema = sg.create_graph_schema()

After Change


    assert len(schema.schema["user"]) == 1

    // Test node type lookup
    for n, ndata in sg.nodes(data=True):
        assert ndata["label"] == schema.get_node_type(n)

    // Test edge type lookup
    node_labels = nx.get_node_attributes(sg, "label")
    for n1, n2, k, edata in sg.edges(keys=True, data=True):
        assert (node_labels[n1], edata["label"], node_labels[n2]) == tuple(
            schema.get_edge_type((n1, n2, k))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: stellargraph/stellargraph
Commit Name: 2d33217ca2c689ff8e577956325291dbe221da70
Time: 2018-07-11
Author: docherty@gmail.com
File Name: tests/data/test_stellargraph.py
Class Name:
Method Name: test_graph_schema


Project Name: ilastik/ilastik
Commit Name: 6a2797afed5511d2cb272245e57d7a7a946204e8
Time: 2019-04-05
Author: k-dominik@users.noreply.github.com
File Name: ilastik/plugins_default/tracking_csv_export.py
Class Name: TrackingCSVExportFormatPlugin
Method Name: export


Project Name: stellargraph/stellargraph
Commit Name: 2d33217ca2c689ff8e577956325291dbe221da70
Time: 2018-07-11
Author: docherty@gmail.com
File Name: tests/data/test_stellargraph.py
Class Name:
Method Name: test_digraph_schema