Skip to content

Commit

Permalink
fix breaking unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
benfred committed Feb 4, 2025
1 parent 033c25f commit cb7857e
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions python/cuvs/cuvs/neighbors/nn_descent/nn_descent.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ cdef class IndexParams:
More iterations produce a better quality graph at cost of performance
termination_threshold : float
The delta at which nn-descent will terminate its iterations
return_distances : bool
Whether or not to include distances in the output.
"""

cdef cuvsNNDescentIndexParams* params
Expand All @@ -90,7 +88,6 @@ cdef class IndexParams:
intermediate_graph_degree=None,
max_iterations=None,
termination_threshold=None,
return_distances=None,
n_clusters=None
):
if metric is not None:
Expand All @@ -103,11 +100,14 @@ cdef class IndexParams:
self.params.max_iterations = max_iterations
if termination_threshold is not None:
self.params.termination_threshold = termination_threshold
if return_distances is not None:
self.params.return_distances = return_distances
if n_clusters is not None:
self.params.n_clusters = n_clusters

# setting this parameter to true will cause an exception in the c++
# api (`Using return_distances set to true requires distance view to
# be allocated.`) - so instead force to be false here
self.params.return_distances = False

@property
def metric(self):
return DISTANCE_NAMES[self.params.metric]
Expand All @@ -132,10 +132,6 @@ cdef class IndexParams:
def termination_threshold(self):
return self.params.termination_threshold

@property
def return_distances(self):
return self.params.return_distances

@property
def n_clusters(self):
return self.params.n_clusters
Expand Down

0 comments on commit cb7857e

Please sign in to comment.