Skip to content

Commit

Permalink
Merge f02c6f8 into 2dce7e4
Browse files Browse the repository at this point in the history
  • Loading branch information
cjweir committed May 15, 2020
2 parents 2dce7e4 + f02c6f8 commit 11b3534
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions pynndescent/pynndescent_.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,10 +803,11 @@ def __init__(

# Create a partial function for distances with arguments
if len(self._dist_args) > 0:
dist_args = self._dist_args

@numba.njit()
def _partial_dist_func(x, y):
return _distance_func(x, y, *self._dist_args)
return _distance_func(x, y, *dist_args)

self._distance_func = _partial_dist_func
else:
Expand Down Expand Up @@ -874,12 +875,11 @@ def _partial_dist_func(x, y):

# Create a partial function for distances with arguments
if len(self._dist_args) > 0:
dist_args = self._dist_args

@numba.njit()
def _partial_dist_func(ind1, data1, ind2, data2):
return _distance_func(
ind1, data1, ind2, data2, *self._dist_args
)
return _distance_func(ind1, data1, ind2, data2, *dist_args)

self._distance_func = _partial_dist_func
else:
Expand Down
2 changes: 1 addition & 1 deletion pynndescent/sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# Just reproduce a simpler version of numpy unique (not numba supported yet)
@numba.njit()
def isclose(a, b, rtol=1.e-5, atol=1.e-8):
def isclose(a, b, rtol=1.0e-5, atol=1.0e-8):
diff = np.abs(a - b)
return diff <= (atol + rtol * np.abs(b))

Expand Down
4 changes: 2 additions & 2 deletions pynndescent/tests/test_pynndescent_.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,8 @@ def test_transformer_output_when_verbose_is_false():
with redirect_stdout(out):
_ = PyNNDescentTransformer(
n_neighbors=4,
metric="euclidean",
metric_kwds={},
metric="standardised_euclidean",
metric_kwds={"sigma": np.ones(spatial_data.shape[1])},
random_state=np.random,
n_trees=5,
n_iters=2,
Expand Down

0 comments on commit 11b3534

Please sign in to comment.