MCPcopy
hub / github.com/dmlc/dgl / test_multigraph_edge_removal

Function test_multigraph_edge_removal

tests/python/common/test_heterograph-remove.py:72–94  ·  view source on GitHub ↗
(idtype)

Source from the content-addressed store, hash-verified

70
71@parametrize_idtype
72def test_multigraph_edge_removal(idtype):
73 g = create_graph(idtype, 5)
74 for i in range(5):
75 g.add_edges(i, i)
76 g.add_edges(i, i)
77 assert g.num_nodes() == 5
78 assert g.num_edges() == 10
79
80 # remove edges
81 g.remove_edges([2, 3])
82 assert g.num_nodes() == 5
83 assert g.num_edges() == 8
84
85 # add edges
86 g.add_edges(1, 1)
87 g.add_edges(1, 1)
88 assert g.num_nodes() == 5
89 assert g.num_edges() == 10
90
91 # remove edges
92 g.remove_edges([0, 1])
93 assert g.num_nodes() == 5
94 assert g.num_edges() == 8
95
96
97@parametrize_idtype

Callers 1

Calls 5

remove_edgesMethod · 0.80
create_graphFunction · 0.70
add_edgesMethod · 0.45
num_nodesMethod · 0.45
num_edgesMethod · 0.45

Tested by

no test coverage detected