def pi_cation(mol1, mol2, cutoff = 5, tolerance = 30):
    r1, plus2 = close_contacts(mol1.ring_dict, mol2.atom_dict[mol2.atom_dict['isplus']], cutoff, x_column='centroid')
    if len(r1) > 0 and len(plus2) > 0:
        angle1 = angle_2v(r1['vector'], plus2['coords'] - r1['centroid'])
        strict = (angle1 > 180 - tolerance) | (angle1 < tolerance)
        return r1, plus2, strict
    else:
        return r1, plus2, np.array([], dtype=bool)
Returns pairs of ring-cation atoms, which meet pi-cation criteria
dataset/ETHPy150Open oddt/oddt/oddt/interactions.py/pi_cation