Fix coordinator worker integration
This commit is contained in:
@@ -2,6 +2,7 @@ from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
from rdkit import DataStructs
|
||||
|
||||
from scimesh.chemistry.dataset import DatasetStats, iter_valid_molecules
|
||||
@@ -61,3 +62,19 @@ def test_graph_supports_less_than_threshold_direction(small_dataset: Path) -> No
|
||||
)
|
||||
|
||||
assert all(edge.similarity <= 0.15 for edge in result.edges)
|
||||
|
||||
|
||||
def test_graph_rejects_duplicate_identifiers(tmp_path: Path) -> None:
|
||||
dataset = tmp_path / "duplicate_ids.tsv"
|
||||
dataset.write_text(
|
||||
"chembl_id\tcanonical_smiles\nDUP\tCCO\nDUP\tCCC\n", encoding="utf-8"
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match="duplicate chembl_id"):
|
||||
build_similarity_graph(dataset, threshold=0.1, block_size=1)
|
||||
|
||||
|
||||
def test_graph_writer_creates_missing_output_directory(tmp_path: Path) -> None:
|
||||
output = tmp_path / "nested" / "edges.csv"
|
||||
write_graph_edges(output, [])
|
||||
assert output.read_text(encoding="utf-8").startswith("source_id,target_id")
|
||||
|
||||
Reference in New Issue
Block a user