def get_nn_dict(cnn, structure, ix):
    """
    For the given atom indices, calculates the nearest neighbours using the
    crystalNN method.

    Args
    ----
    cnn: CrystalNN
        The CrystalNN class object.
    
    structure: pymatgen.core.Structure
        Pymatgen Structure object.

    ix: list
        Indices (int) of atoms to get neighbours for.
    """
    return { i:cnn.get_nn_info(structure,i) for i in ix }