"vscode:/vscode.git/clone" did not exist on "c814bf1a23951fb2fd5341febbae6b0ad0d3cd4a"
test_utils.py 357 Bytes
Newer Older
1
2
3
4
5
6
7
import unittest
import torchani


class TestUtils(unittest.TestCase):

    def testChemicalSymbolsToInts(self):
8
        str2i = torchani.utils.ChemicalSymbolsToInts(['A', 'B', 'C', 'D', 'E', 'F'])
9
10
11
12
13
14
        self.assertEqual(len(str2i), 6)
        self.assertListEqual(str2i('BACCC').tolist(), [1, 0, 2, 2, 2])


if __name__ == '__main__':
    unittest.main()