Ejemplo n.º 1
0
Archivo: bfs.py Proyecto: ahasgw/Helium
    def test_bfs_4(self):
        mol = helium.Molecule()
        SMILES.read('C1CCC(CC)CC1', mol)

        visitor = helium.BFSDebugVisitor()
        helium.breadth_first_search(mol, mol.atom(5), visitor)
        self.compare_file('bfs4.log', visitor.output)
Ejemplo n.º 2
0
Archivo: bfs.py Proyecto: ahasgw/Helium
    def test_closure_recorder_visitor(self):
        mol = helium.Molecule()
        SMILES.read('C1CCCCC1', mol)

        visitor = helium.BFSClosureRecorderVisitor()
        helium.breadth_first_search(mol, visitor)
        self.assertListEqual([3], visitor.back_bonds)
Ejemplo n.º 3
0
Archivo: bfs.py Proyecto: ahasgw/Helium
    def test_custom_visitor(self):
        mol = helium.Molecule()
        SMILES.read('C1CCC(CC)CC1', mol)

        visitor = BFSTestVisitor()
        helium.breadth_first_search(mol, visitor)
        self.compare_file('bfs1.log', visitor.output)
Ejemplo n.º 4
0
Archivo: bfs.py Proyecto: ahasgw/Helium
    def test_atom_order_visitor(self):
        mol = helium.Molecule()
        SMILES.read('CCC', mol)

        visitor = helium.BFSAtomOrderVisitor()
        helium.breadth_first_search(mol, visitor)
        self.assertListEqual([0, 1, 2], visitor.atoms)
Ejemplo n.º 5
0
Archivo: bfs.py Proyecto: ahasgw/Helium
    def test_bond_order_visitor(self):
        mol = helium.Molecule()
        SMILES.read('CCC', mol)

        visitor = helium.BFSBondOrderVisitor()
        helium.breadth_first_search(mol, visitor)
        self.assertListEqual([0, 1], visitor.bonds)
Ejemplo n.º 6
0
    def test_bfs_4(self):
        mol = helium.Molecule()
        SMILES.read('C1CCC(CC)CC1', mol)

        visitor = helium.BFSDebugVisitor()
        helium.breadth_first_search(mol, mol.atom(5), visitor)
        self.compare_file('bfs4.log', visitor.output)
Ejemplo n.º 7
0
    def test_custom_visitor(self):
        mol = helium.Molecule()
        SMILES.read('C1CCC(CC)CC1', mol)

        visitor = BFSTestVisitor()
        helium.breadth_first_search(mol, visitor)
        self.compare_file('bfs1.log', visitor.output)
Ejemplo n.º 8
0
    def test_closure_recorder_visitor(self):
        mol = helium.Molecule()
        SMILES.read('C1CCCCC1', mol)

        visitor = helium.BFSClosureRecorderVisitor()
        helium.breadth_first_search(mol, visitor)
        self.assertListEqual([3], visitor.back_bonds)
Ejemplo n.º 9
0
    def test_bond_order_visitor(self):
        mol = helium.Molecule()
        SMILES.read('CCC', mol)

        visitor = helium.BFSBondOrderVisitor()
        helium.breadth_first_search(mol, visitor)
        self.assertListEqual([0, 1], visitor.bonds)
Ejemplo n.º 10
0
    def test_atom_order_visitor(self):
        mol = helium.Molecule()
        SMILES.read('CCC', mol)

        visitor = helium.BFSAtomOrderVisitor()
        helium.breadth_first_search(mol, visitor)
        self.assertListEqual([0, 1, 2], visitor.atoms)