test_utils.py 458 Bytes
Newer Older
1
import unittest
2
import torch
3
4
5
import torchani


6
class TestUtils(torchani.testing.TestCase):
7
8

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

13
14
15
    def testHessianJIT(self):
        torch.jit.script(torchani.utils.hessian)

16
17
18

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