Example #1
0
             hydrogen1=stk.H(14),
             hydrogen2=stk.H(15),
             atom=stk.C(4),
             bonders=(stk.C(5), ),
             deleters=(stk.N(7), stk.H(14), stk.H(15)),
         ),
     ),
 ),
 lambda: CaseData(
     factory=stk.ThioacidFactory(),
     molecule=stk.BuildingBlock('O=C(S)CC(S)=O'),
     functional_groups=(
         stk.Thioacid(
             carbon=stk.C(1),
             oxygen=stk.O(0),
             sulfur=stk.S(2),
             hydrogen=stk.H(7),
             atom=stk.C(3),
             bonders=(stk.C(1), ),
             deleters=(stk.S(2), stk.H(7)),
         ),
         stk.Thioacid(
             carbon=stk.C(4),
             oxygen=stk.O(6),
             sulfur=stk.S(5),
             hydrogen=stk.H(10),
             atom=stk.C(3),
             bonders=(stk.C(4), ),
             deleters=(stk.S(5), stk.H(10)),
         ),
     ),
Example #2
0
            atom=stk.C(4),
            bonders=(stk.C(4), ),
            deleters=(stk.N(0), stk.H(2), stk.H(3)),
        ),
        stk.SecondaryAmino(
            nitrogen=stk.N(12),
            hydrogen=stk.H(21),
            atom1=stk.C(0),
            atom2=stk.C(12),
            bonders=(stk.N(12), ),
            deleters=(stk.H(21), ),
        ),
        stk.Thioacid(
            carbon=stk.C(0),
            oxygen=stk.O(12),
            sulfur=stk.S(21),
            hydrogen=stk.H(2),
            atom=stk.C(1),
            bonders=(stk.C(0), ),
            deleters=(stk.S(21), stk.H(2)),
        ),
        stk.Thiol(
            sulfur=stk.S(12),
            hydrogen=stk.H(21),
            atom=stk.C(32),
            bonders=(stk.C(32), ),
            deleters=(stk.S(12), stk.H(21)),
        ),
        stk.SingleAtom(atom=stk.Fe(0)),
    ), )
def functional_group1(request):
Example #3
0
            hydrogen2=stk.H(2),
            atom=stk.C(3),
            bonders=(stk.C(3), ),
            deleters=(stk.N(0), stk.H(1), stk.H(2)),),
        lambda: stk.SecondaryAmino(
            nitrogen=stk.N(0),
            hydrogen=stk.H(1),
            atom1=stk.C(2),
            atom2=stk.C(3),
            bonders=(stk.N(0), ),
            deleters=(stk.H(1), ),
        ),
        lambda: stk.Thioacid(
            carbon=stk.C(0),
            oxygen=stk.O(1),
            sulfur=stk.S(2),
            hydrogen=stk.H(3),
            atom=stk.C(4),
            bonders=(stk.C(0), ),
            deleters=(stk.S(2), stk.H(3)),
        ),
        lambda: stk.Thiol(
            sulfur=stk.S(0),
            hydrogen=stk.H(1),
            atom=stk.C(2),
            bonders=(stk.C(2), ),
            deleters=(stk.S(0), stk.H(1)),
        ),
        lambda: stk.SingleAtom(atom=stk.Fe(0)),
    ),
)
Example #4
0
def thiol(get_atom_ids):
    a, b, c = get_atom_ids(3)
    return _thiol(stk.S(a), stk.H(b), stk.C(c))
Example #5
0
     )
 ),
 lambda: CaseData(
     molecule=stk.ConstructedMolecule(
         topology_graph=stk.polymer.Linear(
             building_blocks=(bb1, bb2),
             repeating_unit='AB',
             num_repeating_units=1,
         ),
     ),
     result=stk.ConstructedMolecule.init(
         atoms=(
             stk.C(0, 2),
             stk.O(1, 1),
             stk.N(2, 1),
             stk.S(3),
         ),
         bonds=(
             stk.Bond(stk.C(0, 2), stk.N(2, 1), 1),
             stk.Bond(stk.O(1, 1), stk.S(3), 1),
             stk.Bond(stk.N(2, 1), stk.S(3), 1),
         ),
         position_matrix=np.array([]),
         atom_infos=(
             stk.AtomInfo(
                 atom=stk.C(0, 2),
                 building_block_atom=stk.C(0, 2),
                 building_block=canonical_bb1,
                 building_block_id=0,
             ),
             stk.AtomInfo(
Example #6
0
     )
 ),
 CaseData(
     molecule=stk.ConstructedMolecule(
         topology_graph=stk.polymer.Linear(
             building_blocks=(bb1, bb2),
             repeating_unit='AB',
             num_repeating_units=1,
         ),
     ),
     result=stk.ConstructedMolecule.init(
         atoms=(
             stk.C(0, 2),
             stk.O(1, 1),
             stk.N(2, 1),
             stk.S(3),
         ),
         bonds=(
             stk.Bond(stk.C(0, 2), stk.N(2, 1), 1),
             stk.Bond(stk.O(1, 1), stk.S(3), 1),
             stk.Bond(stk.N(2, 1), stk.S(3), 1),
         ),
         position_matrix=np.array([]),
         atom_infos=(
             stk.AtomInfo(
                 atom=stk.C(0, 2),
                 building_block=bb1,
                 building_block_id=0,
             ),
             stk.AtomInfo(
                 atom=stk.O(1, 1),
Example #7
0
def thioacid(get_atom_ids):
    a, b, c, d, e = get_atom_ids(5)
    return _thioacid(stk.C(a), stk.O(b), stk.S(c), stk.H(d), stk.C(e))
Example #8
0
def get_case_data_2() -> CaseData:
    bb1 = stk.BuildingBlock('[C+2][N+]Br', [stk.BromoFactory()])
    canonical_bb1 = bb1.with_canonical_atom_ordering()
    bb2 = stk.BuildingBlock('IS[O+]', [stk.IodoFactory()])
    canonical_bb2 = bb2.with_canonical_atom_ordering()

    return CaseData(
        molecule=stk.ConstructedMolecule(
            topology_graph=stk.polymer.Linear(
                building_blocks=(bb1, bb2),
                repeating_unit='AB',
                num_repeating_units=1,
            ),
        ),
        result=stk.ConstructedMolecule.init(
            atoms=(
                stk.C(0, 2),
                stk.O(1, 1),
                stk.N(2, 1),
                stk.S(3),
            ),
            bonds=(
                stk.Bond(stk.C(0, 2), stk.N(2, 1), 1),
                stk.Bond(stk.O(1, 1), stk.S(3), 1),
                stk.Bond(stk.N(2, 1), stk.S(3), 1),
            ),
            position_matrix=np.array([]),
            atom_infos=(
                stk.AtomInfo(
                    atom=stk.C(0, 2),
                    building_block_atom=stk.C(0, 2),
                    building_block=canonical_bb1,
                    building_block_id=0,
                ),
                stk.AtomInfo(
                    atom=stk.O(1, 1),
                    building_block_atom=stk.O(0, 1),
                    building_block=canonical_bb2,
                    building_block_id=1,
                ),
                stk.AtomInfo(
                    atom=stk.N(2, 1),
                    building_block_atom=stk.N(2, 1),
                    building_block=canonical_bb1,
                    building_block_id=0,
                ),
                stk.AtomInfo(
                    atom=stk.S(3),
                    building_block_atom=stk.S(2),
                    building_block=canonical_bb2,
                    building_block_id=1,
                ),
            ),
            bond_infos=(
                stk.BondInfo(
                    bond=stk.Bond(stk.C(0, 2), stk.N(2, 1), 1),
                    building_block=canonical_bb1,
                    building_block_id=0,
                ),
                stk.BondInfo(
                    bond=stk.Bond(stk.O(1, 1), stk.S(3), 1),
                    building_block=canonical_bb2,
                    building_block_id=1,
                ),
                stk.BondInfo(
                    bond=stk.Bond(stk.N(2, 1), stk.S(3), 1),
                    building_block=None,
                    building_block_id=None,
                ),
            ),
            num_building_blocks={
                canonical_bb1: 1,
                canonical_bb2: 1,
            },
        ),
    )
Example #9
0
import pytest
import stk


@pytest.fixture(
    params=[
        lambda bond: {},
        lambda bond: {
            bond.get_atom1().get_id(): stk.Be(33)
        },
        lambda bond: {
            bond.get_atom2().get_id(): stk.Bi(122)
        },
        lambda bond: {
            bond.get_atom1().get_id(): stk.K(4),
            bond.get_atom2().get_id(): stk.S(7),
        },
    ], )
def get_atom_map(request):
    """
    Return a valid `atom_map` parameter for a bond.

    Parameters
    ----------
    bond : :class:`.Bond`
        The bond, for which the `atom_map` parameter needs to be
        created.

    Returns
    -------
    :class:`dict`