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 8f62e8b commit f7a900f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cupyx/scipy/spatial/distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
cuvs_available = True
except ImportError:
try:
#cuVS distance primitives were previously in pylibraft
# cuVS distance primitives were previously in pylibraft
from pylibraft.distance import pairwise_distance
pylibraft_available = True
except ImportError:
Expand Down Expand Up @@ -110,12 +110,14 @@ def __init__(self, canonical_name=None, aka=None,

_METRICS_NAMES = list(_METRICS.keys())


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')


def minkowski(u, v, p):
"""Compute the Minkowski distance between two 1-D arrays.
Expand Down Expand Up @@ -496,7 +498,6 @@ def cdist(XA, XB, metric='euclidean', out=None, **kwargs):
"""
check_soft_dependencies()


if pylibraft_available or \
(cuvs_available and XA.dtype not in ['float32', 'float64']):
XA = cupy.asarray(XA, dtype='float32')
Expand Down

0 comments on commit f7a900f

Please sign in to comment.