Skip to content

Commit

Permalink
added test
Browse files Browse the repository at this point in the history
  • Loading branch information
arunppsg committed Aug 10, 2023
1 parent c902e29 commit f0bbe80
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions deepchem/splits/tests/test_scaffold_splitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,14 @@ def test_scaffolds(self):
# has to be smaller or equal than number of total molecules
scaffolds_separate_cnt = len(scaffolds_separate)
self.assertTrue(scaffolds_separate_cnt <= train_dataset.X.shape[0])

def test_generate_scaffold(self):
from deepchem.splits.splitters import _generate_scaffold
valid_smiles = r's1cc(nc1\[N]=C(\N)N)C'
scaffold = _generate_scaffold(valid_smiles)
self.assertTrue(scaffold == 'c1cscn1')

# Invalid because valence for atom 5 N is greater than permitted (4)
invalid_smiles = r's1cc(nc1\[NH]=C(\N)N)C'
scaffold = _generate_scaffold(invalid_smiles)
self.assertIsNone(scaffold)

0 comments on commit f0bbe80

Please sign in to comment.