Exemple #1
0
    def test_2_atoms(self):
        smi = 'CCC'
        mol = Molecule().from_smiles(smi)
        atom_indices = [1, 2]
        distances = compute_atom_distance(atom_indices, mol)

        expected = {(1, 2): 1}
        self.assertEquals(distances, expected)
Exemple #2
0
def _compute_agglomerate_distance(agglomerates, mol):
    """
    Iterates over a list of lists containing atom indices.
    For each list the distances between the atoms is computed.
    A list of distances is returned.

    """

    cython.declare(
        distances=list,
        agglomerate=list,
        dist=dict,
    )

    distances = []
    for agglomerate in agglomerates:
        dist = pathfinder.compute_atom_distance(agglomerate, mol)
        distances.append(dist)

    return distances
def _compute_agglomerate_distance(agglomerates, mol):
    """
    Iterates over a list of lists containing atom indices.
    For each list the distances between the atoms is computed.
    A list of distances is returned.

    """

    cython.declare(
        distances=list,
        agglomerate=list,
        dist=dict,
    )

    distances = []
    for agglomerate in agglomerates:
        dist = pathfinder.compute_atom_distance(agglomerate, mol)
        distances.append(dist)

    return distances