def test_featurizer(self): mg = MolecularGraph() mol = mol_from_smiles(self.qm9_000001['smiles']) mol_graph = mg.convert(mol) self.assertEqual(len(mol_graph['index1']), 20) # 20 bonds in total, including double counting self.assertEqual(len(mol_graph['atom']), 5) # 5 atoms self.assertListEqual(mol_graph['state'][0], [0, 0]) # dummy state [0, 0] mol_graph = mg.convert(mol, state_attributes=[[1, 2]]) self.assertListEqual(mol_graph['state'][0], [1, 2])
def setUpClass(cls): with open(os.path.join(module_dir, 'qm9', '000001.json'), 'r') as f: cls.qm9_000001 = json.load(f) cls.mol = mol_from_smiles(cls.qm9_000001['smiles'])
def setUpClass(cls): with open(os.path.join(module_dir, "qm9", "000001.json")) as f: cls.qm9_000001 = json.load(f) cls.mol = mol_from_smiles(cls.qm9_000001["smiles"])