Skip to content

Commit

Permalink
Fixing style
Browse files Browse the repository at this point in the history
  • Loading branch information
cjnolet committed Dec 19, 2024
1 parent b8017f5 commit 527f659
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion cupyx/scipy/spatial/distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
14 changes: 7 additions & 7 deletions tests/cupyx_tests/scipy_tests/spatial_tests/test_distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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):

Expand Down Expand Up @@ -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:

Expand All @@ -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):

Expand All @@ -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):

Expand Down

0 comments on commit 527f659

Please sign in to comment.