Skip to content

Commit 812b3a4

Browse files
committed
Refactoring
1 parent 19e727d commit 812b3a4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

python_bindings/tests/bindings_test_replace.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ def testRandomSelf(self):
1313
num_elements = 5000
1414
max_num_elements = 2 * num_elements
1515

16+
recall_threshold = 0.98
17+
1618
# Generating sample data
1719
print("Generating data")
1820
# batch 1
@@ -119,7 +121,7 @@ def testRandomSelf(self):
119121
labels_found, _ = hnsw_index.knn_query(data4, k=1)
120122
recall = np.mean(labels_found.reshape(-1) == labels4)
121123
print(f"Recall for the 4 batch: {recall}")
122-
self.assertGreater(recall, 0.98)
124+
self.assertGreater(recall, recall_threshold)
123125

124126
# Delete batch 4
125127
print("Deleting batch 4")
@@ -138,6 +140,6 @@ def testRandomSelf(self):
138140
labels_found, _ = hnsw_index_pckl.knn_query(data3, k=1)
139141
recall = np.mean(labels_found.reshape(-1) == labels3)
140142
print(f"Recall for the 3 batch: {recall}")
141-
self.assertGreater(recall, 0.98)
143+
self.assertGreater(recall, recall_threshold)
142144

143145
os.remove(index_path)

0 commit comments

Comments
 (0)