Skip to content

Commit

Permalink
Update HITS exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
eriknw committed Nov 2, 2023
1 parent 5bf0ee6 commit 784d291
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ def hits(G, max_iter=100, tol=1.0e-8, nstart=None, normalized=True):
return {}, {}
if nstart is not None:
nstart = G._dict_to_nodearray(nstart, 0, np.float32)
if max_iter <= 0:
if nx.__version__[:3] <= "3.2":
raise ValueError("`maxiter` must be a positive integer.")
raise nx.PowerIterationFailedConvergence(max_iter)
try:
node_ids, hubs, authorities = plc.hits(
resource_handle=plc.ResourceHandle(),
Expand Down
5 changes: 1 addition & 4 deletions python/nx-cugraph/nx_cugraph/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,14 @@ def key(testpath):
no_multigraph = "multigraphs not currently supported"
louvain_different = "Louvain may be different due to RNG"
no_string_dtype = "string edge values not currently supported"
different_power_iteration = (
"different behavior of power iteration convergence and/or exception"
)

xfail = {
key(
"test_eigenvector_centrality.py:TestEigenvectorCentrality.test_P3"
): "Power iteration failed (don't know why; networkx converges in 8 steps)",
key(
"test_hits.py:TestHITS.test_hits_not_convergent"
): different_power_iteration,
): "HITS doesn't raise after failing to converge after max_iter iterations",
}

from packaging.version import parse
Expand Down

0 comments on commit 784d291

Please sign in to comment.