Skip to content

Commit

Permalink
Updates xfail list for HITS for NX versions 3.2 and older.
Browse files Browse the repository at this point in the history
  • Loading branch information
rlratzel committed Nov 21, 2023
1 parent 12ead7d commit 5966d9e
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions python/nx-cugraph/nx_cugraph/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,32 @@ def key(testpath):
louvain_different = "Louvain may be different due to RNG"
no_string_dtype = "string edge values not currently supported"

xfail = {
key(
"test_hits.py:TestHITS.test_hits_not_convergent"
): "HITS doesn't raise after failing to converge after max_iter iterations",
}
xfail = {}

from packaging.version import parse

nxver = parse(nx.__version__)
if nxver.major == 3 and nxver.minor in {0, 1}:

if nxver.major == 3 and nxver.minor <= 2:
# Networkx versions prior to 3.2.1 have tests written to expect
# sp.sparse.linalg.ArpackNoConvergence exceptions raised on no
# convergence in HITS. Newer versions since the merge of
# https://github.com/networkx/networkx/pull/7084 expect
# nx.PowerIterationFailedConvergence, which is what nx_cugraph.hits
# raises, so we mark them as xfail for previous versions of NX.
xfail.update(
{
key(
"test_hits.py:TestHITS.test_hits_not_convergent"
): "nx_cugraph.hits raises updated exceptions not caught in these tests",
}
)
elif nxver.major == 3 and nxver.minor <= 1:
# MAINT: networkx 3.0, 3.1
# NetworkX 3.2 added the ability to "fallback to nx" if backend algorithms
# raise NotImplementedError or `can_run` returns False. The tests below
# exercise behavior we have not implemented yet, so we mark them as xfail
# for previous versions of NetworkX.
# for previous versions of NX.
xfail.update(
{
key(
Expand Down

0 comments on commit 5966d9e

Please sign in to comment.