コード例 #1
0
 def test_simple_molecule_graph(self):
     mol = Molecule(['C', 'H', 'O'], [[0, 0, 0], [1, 0, 0], [2, 0, 0]])
     graph = SimpleMolGraph().convert(mol)
     self.assertListEqual(graph['atom'], [6, 1, 8])
     self.assertTrue(np.allclose(graph['bond'], [1, 2, 1, 1, 2, 1]))
     self.assertListEqual(graph['index1'], [0, 0, 1, 1, 2, 2])
     self.assertListEqual(graph['index2'], [1, 2, 0, 2, 0, 1])
コード例 #2
0
 def test_simple_molecule_graph(self):
     mol = Molecule(["C", "H", "O"], [[0, 0, 0], [1, 0, 0], [2, 0, 0]])
     graph = SimpleMolGraph().convert(mol)
     self.assertListEqual(to_list(graph["atom"]), [6, 1, 8])
     self.assertTrue(np.allclose(graph["bond"], [1, 2, 1, 1, 2, 1]))
     self.assertListEqual(to_list(graph["index1"]), [0, 0, 1, 1, 2, 2])
     self.assertListEqual(to_list(graph["index2"]), [1, 2, 0, 2, 0, 1])