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



    // 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))
        )

def test_digraph_schema():
    sg = create_graph_1(StellarDiGraph())
    schema = sg.create_graph_schema()
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: 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


Project Name: dmlc/dgl
Commit Name: 455ea48570f1af63b1270c8ccda49fbe3deb9bcc
Time: 2018-12-04
Author: ly979@nyu.edu
File Name: python/dgl/graph.py
Class Name: DGLGraph
Method Name: from_networkx