diff --git a/umap/plot.py b/umap/plot.py index 1d54d322..db19ac64 100644 --- a/umap/plot.py +++ b/umap/plot.py @@ -1589,5 +1589,4 @@ def nearest_neighbour_distribution(umap_object, bins=25, ax=None): ax.hist(nn_distances, bins=bins) - return ax - + return ax \ No newline at end of file diff --git a/umap/utils.py b/umap/utils.py index 3e2bb28a..0f3c9dc6 100644 --- a/umap/utils.py +++ b/umap/utils.py @@ -212,6 +212,9 @@ def average_nn_distance(dist_matrix): averages = sum_non_zero_elems/count_non_zero_elems if any(np.isnan(averages)): - warn("Embedding contains disconnected vertices which will be ignored. Use umap.utils.disconnected_vertices() to identify them.") - - return averages + warn( + "Embedding contains disconnected vertices which will be ignored." + "Use umap.utils.disconnected_vertices() to identify them." + ) + + return averages \ No newline at end of file