예제 #1
0
 def count():
     cnt, n = 0, 0
     for s in sys.stdin:
         s = s.split()[0]
         tree = MolTree(s)
         tree.recover()
         tree.assemble()
         for node in tree.nodes:
             cnt += len(node.cands)
         n += len(tree.nodes)
예제 #2
0
 def enum_test():
     for s in sys.stdin:
         s = s.split()[0]
         tree = MolTree(s)
         tree.recover()
         tree.assemble()
         for node in tree.nodes:
             if node.label not in node.cands:
                 print(tree.smiles)
                 print(node.smiles, [x.smiles for x in node.neighbors])
                 print(node.label, len(node.cands))
예제 #3
0
 def test_enum(self):
     """test_enum."""
     for smiles in self.__smiles:
         tree = MolTree(smiles)
         tree.recover()
         tree.assemble()
         for node in tree.get_nodes():
             if node.get_label() not in node.get_candidates():
                 print(tree.get_smiles())
                 print(node.get_smiles(),
                       [x.get_smiles() for x in node.get_neighbors()])
                 print(node.get_label(), len(node.get_candidates()))
예제 #4
0
 def __getitem__(self, idx):
     smiles = self.data[idx]
     mol_tree = MolTree(smiles)
     mol_tree.recover()
     mol_tree.assemble()
     return mol_tree, self.prop_data[idx]