Skip to content

Commit

Permalink
fix styling issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Iroy30 committed Mar 25, 2019
1 parent 4a92876 commit d381cca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
13 changes: 5 additions & 8 deletions python/cugraph/jaccard/test_jaccard.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ def networkx_call(M):
G = nx.DiGraph(M)
Gnx = G.to_undirected()

#print(M.data)

# Networkx Jaccard Call
print('Solving... ')
t1 = time.time()
Expand All @@ -96,7 +94,6 @@ def networkx_call(M):
dst = []
coeff = []
for u, v, p in preds:
#print(Gnx[u][v]['weight'])
src.append(u)
dst.append(v)
coeff.append(p)
Expand All @@ -121,13 +118,14 @@ def test_jaccard(graph_file):

assert len(cu_coeff) == len(nx_coeff)
for i in range(len(cu_coeff)):
if(abs(cu_coeff[i] - nx_coeff[i]) > tol*1.1 and
cu_src[i] == nx_src[i] and cu_dst[i] == nx_dst[i]):
if(abs(cu_coeff[i] - nx_coeff[i]) > tol*1.1 and
cu_src[i] == nx_src[i] and cu_dst[i] == nx_dst[i]):
err += 1

print("Mismatches: %d" % err)
assert err == 0


@pytest.mark.parametrize('graph_file', ['/datasets/networks/netscience.mtx'])
def test_jaccard_edgevals(graph_file):

Expand All @@ -141,10 +139,9 @@ def test_jaccard_edgevals(graph_file):

assert len(cu_coeff) == len(nx_coeff)
for i in range(len(cu_coeff)):
if(abs(cu_coeff[i] - nx_coeff[i]) > tol*1.1 and
cu_src[i] == nx_src[i] and cu_dst[i] == nx_dst[i]):
if(abs(cu_coeff[i] - nx_coeff[i]) > tol*1.1 and
cu_src[i] == nx_src[i] and cu_dst[i] == nx_dst[i]):
err += 1

print("Mismatches: %d" % err)
assert err == 0

5 changes: 2 additions & 3 deletions python/cugraph/sssp/test_sssp.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def cugraph_call(M, source, edgevals=False):
t1 = time.time()

dist = cugraph.sssp(G, source)
print(dist)

t2 = time.time() - t1
print('Time : '+str(t2))

Expand Down Expand Up @@ -147,6 +147,5 @@ def test_sssp_edgevals(graph_file, source):
else:
if (cu_paths[i][0] in nx_paths.keys()):
err = err + 1

assert err == 0

assert err == 0

0 comments on commit d381cca

Please sign in to comment.