Skip to content

Commit

Permalink
Re-black
Browse files Browse the repository at this point in the history
  • Loading branch information
lmcinnes committed Sep 11, 2019
1 parent c4f39f7 commit 9a3ac7d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
14 changes: 2 additions & 12 deletions umap/sparse_nndescent.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,7 @@ def sparse_nn_descent_internal_low_memory(
print("\t", n, " / ", n_iters)

(new_candidate_neighbors, old_candidate_neighbors) = new_build_candidates(
current_graph,
n_vertices,
n_neighbors,
max_candidates,
rng_state,
rho,
current_graph, n_vertices, n_neighbors, max_candidates, rng_state, rho
)

c = 0
Expand Down Expand Up @@ -156,12 +151,7 @@ def sparse_nn_descent_internal_high_memory(
print("\t", n, " / ", n_iters)

(new_candidate_neighbors, old_candidate_neighbors) = new_build_candidates(
current_graph,
n_vertices,
n_neighbors,
max_candidates,
rng_state,
rho,
current_graph, n_vertices, n_neighbors, max_candidates, rng_state, rho
)

c = 0
Expand Down
1 change: 1 addition & 0 deletions umap/tests/test_umap.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ def test_nn_descent_neighbor_accuracy():
"NN-descent did not get 99% " "accuracy on nearest neighbors",
)


def test_nn_descent_neighbor_accuracy_low_memory():
knn_indices, knn_dists, _ = nearest_neighbors(
nn_data, 10, "euclidean", {}, False, np.random, low_memory=True
Expand Down
13 changes: 9 additions & 4 deletions umap/umap_.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,14 @@ def smooth_knn_dist(distances, k, n_iter=64, local_connectivity=1.0, bandwidth=1


def nearest_neighbors(
X, n_neighbors, metric, metric_kwds, angular, random_state, low_memory=False, verbose=False
X,
n_neighbors,
metric,
metric_kwds,
angular,
random_state,
low_memory=False,
verbose=False,
):
"""Compute the ``n_neighbors`` nearest points for each data point in ``X``
under ``metric``. This may be exact, but more likely is approximated via
Expand Down Expand Up @@ -785,9 +792,7 @@ def discrete_metric_simplicial_set_intersection(
if metric in dist.named_distances:
metric_func = dist.named_distances[metric]
else:
raise ValueError(
"Discrete intersection metric is not recognized"
)
raise ValueError("Discrete intersection metric is not recognized")

fast_metric_intersection(
simplicial_set.row,
Expand Down

0 comments on commit 9a3ac7d

Please sign in to comment.