Skip to content

Commit

Permalink
add short descriptions to tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
mfbalin committed Jun 29, 2023
1 parent c3deb84 commit 009be59
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/python/common/sampling/test_sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,7 @@ def _test3(p, replace):
def _test_sample_labors(hypersparse, prob):
g, hg = _gen_neighbor_sampling_test_graph(hypersparse, False)

# test with seed nodes [0, 1]
def _test1(p):
subg = dgl.sampling.sample_labors(g, [0, 1], -1, prob=p)[0]
assert subg.num_nodes() == g.num_nodes()
Expand Down Expand Up @@ -719,7 +720,8 @@ def _test1(p):

_test1(prob)

def _test2(p): # fanout > #neighbors
# test with seed nodes [0, 2]
def _test2(p):
subg = dgl.sampling.sample_labors(g, [0, 2], -1, prob=p)[0]
assert subg.num_nodes() == g.num_nodes()
u, v = subg.edges()
Expand Down Expand Up @@ -753,6 +755,7 @@ def _test2(p): # fanout > #neighbors

_test2(prob)

# test with heterogenous seed nodes
def _test3(p):
subg = dgl.sampling.sample_labors(
hg, {"user": [0, 1], "game": 0}, -1, prob=p
Expand Down

0 comments on commit 009be59

Please sign in to comment.