Support similar and dissimilar threshold searches

This commit is contained in:
Emil
2026-07-13 23:34:58 +03:00
parent 9c3965a449
commit 134c1010f1
6 changed files with 117 additions and 11 deletions
+8
View File
@@ -53,3 +53,11 @@ def test_graph_is_block_size_independent_and_deterministic(
write_graph_edges(first_path, first.edges)
write_graph_edges(second_path, repeated.edges)
assert first_path.read_bytes() == second_path.read_bytes()
def test_graph_supports_less_than_threshold_direction(small_dataset: Path) -> None:
result = build_similarity_graph(
small_dataset, threshold=0.15, block_size=2, threshold_direction="less"
)
assert all(edge.similarity <= 0.15 for edge in result.edges)