Skip to content

Commit 6518016

Browse files
author
Ricardo J. Rodríguez
committed
minor fix on HNSW draw
1 parent 611a093 commit 6518016

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

datalayer/hnsw.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -966,13 +966,13 @@ def draw(self, filename: str, show_distance: bool=True, format="pdf",\
966966
features[key].update(value)
967967

968968
edge_label = ""
969-
# calculate similiraty score to discriminate whether this link is drawn (depends on threshold value)
969+
# calculate similarity score to discriminate whether this link is drawn (depends on threshold value)
970970
similarity_score = node.calculate_similarity(neighbor)
971971
if show_distance:
972972
edge_label = similarity_score
973973

974974
if self._distance_algorithm.is_spatial():
975-
threshold_flag = similarity_score <= threshold
975+
threshold_flag = similarity_score <= threshold or threshold == 0.0 # initial condition
976976
else:
977977
threshold_flag = similarity_score >= threshold
978978

@@ -993,7 +993,6 @@ def draw(self, filename: str, show_distance: bool=True, format="pdf",\
993993
node_colors.append(color)
994994
# add to graph
995995
if threshold_flag:
996-
print("Draw!")
997996
G.add_edge(node_label, neigh_label, label=edge_label)
998997
if G.number_of_nodes() == 0: # this can happen when a subset is given
999998
logger.debug(f"L{layer} without nodes, skipping drawing ...")

0 commit comments

Comments
 (0)