test_utils.py 428 Bytes
Newer Older
1
import unittest
Gao, Xiang's avatar
Gao, Xiang committed
2
import torch
3
4
5
6
7
8
9
10
11
12
import torchani


class TestUtils(unittest.TestCase):

    def testChemicalSymbolsToInts(self):
        str2i = torchani.utils.ChemicalSymbolsToInts('ABCDEF')
        self.assertEqual(len(str2i), 6)
        self.assertListEqual(str2i('BACCC').tolist(), [1, 0, 2, 2, 2])

Gao, Xiang's avatar
Gao, Xiang committed
13
14
15
    def testHessianJIT(self):
        torch.jit.script(torchani.utils.hessian)

16
17
18

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