From 5966d9e5268d642608a0c8d22a206358ab136457 Mon Sep 17 00:00:00 2001 From: Rick Ratzel Date: Tue, 21 Nov 2023 16:33:54 -0600 Subject: [PATCH] Updates xfail list for HITS for NX versions 3.2 and older. --- python/nx-cugraph/nx_cugraph/interface.py | 25 ++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/python/nx-cugraph/nx_cugraph/interface.py b/python/nx-cugraph/nx_cugraph/interface.py index f03948828f6..e6521e185f7 100644 --- a/python/nx-cugraph/nx_cugraph/interface.py +++ b/python/nx-cugraph/nx_cugraph/interface.py @@ -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(