From 527f659dd6080bd5fb7b0991264d7e01265b9f23 Mon Sep 17 00:00:00 2001 From: "Corey J. Nolet" Date: Thu, 19 Dec 2024 15:17:50 -0500 Subject: [PATCH] Fixing style --- cupyx/scipy/spatial/distance.py | 3 ++- .../scipy_tests/spatial_tests/test_distance.py | 14 +++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/cupyx/scipy/spatial/distance.py b/cupyx/scipy/spatial/distance.py index 1f716ea75aa..8d12090daf2 100644 --- a/cupyx/scipy/spatial/distance.py +++ b/cupyx/scipy/spatial/distance.py @@ -113,7 +113,8 @@ def __init__(self, canonical_name=None, aka=None, def check_soft_dependencies(): if not cuvs_available: if not pylibraft_available: - raise RuntimeError('cuVS >= 24.12 or pylibraft < 24.12 should be installed to use this feature') + raise RuntimeError('cuVS >= 24.12 or pylibraft < ' + '24.12 should be installed to use this feature') def minkowski(u, v, p): """Compute the Minkowski distance between two 1-D arrays. diff --git a/tests/cupyx_tests/scipy_tests/spatial_tests/test_distance.py b/tests/cupyx_tests/scipy_tests/spatial_tests/test_distance.py index 941e73eb609..be3af3fd1bc 100644 --- a/tests/cupyx_tests/scipy_tests/spatial_tests/test_distance.py +++ b/tests/cupyx_tests/scipy_tests/spatial_tests/test_distance.py @@ -11,10 +11,10 @@ scipy_available = False import cupyx.scipy.spatial.distance # NOQA try: - import pylibraft # NOQA - pylibraft_available = True + import cuvs # NOQA + cuvs_available = True except ModuleNotFoundError: - pylibraft_available = False + cuvs_available = False from cupy import testing @@ -30,7 +30,7 @@ 'order': ["C", "F"] })) @pytest.mark.skipif(cupy.cuda.runtime.is_hip, reason="tests for CUDA only") -@pytest.mark.skipif(not scipy_available or not pylibraft_available, +@pytest.mark.skipif(not scipy_available or not cuvs_available, reason='requires scipy and pylibraft') class TestCdist(unittest.TestCase): @@ -92,7 +92,7 @@ def test_cdist_(self, xp, scp): 'order': ["C", "F"] })) @pytest.mark.skipif(cupy.cuda.runtime.is_hip, reason="tests for CUDA only") -@pytest.mark.skipif(not scipy_available or not pylibraft_available, +@pytest.mark.skipif(not scipy_available or not cuvs_available, reason='requires scipy and pylibraft') class TestPdist: @@ -118,7 +118,7 @@ def test_pdist_(self, xp, scp): 'order': ["C", "F"] })) @pytest.mark.skipif(cupy.cuda.runtime.is_hip, reason="tests for CUDA only") -@pytest.mark.skipif(not scipy_available or not pylibraft_available, +@pytest.mark.skipif(not scipy_available or not cuvs_available, reason='requires scipy and pylibraft') class TestDistanceMatrix(unittest.TestCase): @@ -143,7 +143,7 @@ def test_distance_matrix_(self, xp, scp): 'order': ["C", "F"] })) @pytest.mark.skipif(cupy.cuda.runtime.is_hip, reason="tests for CUDA only") -@pytest.mark.skipif(not scipy_available or not pylibraft_available, +@pytest.mark.skipif(not scipy_available or not cuvs_available, reason='requires scipy and pylibraft') class TestDistanceFunction(unittest.TestCase):