def angle_to(self, other): """ Register this atom as angle partners. Cannot angle to itself. If that is attempted, a BondError is raised """ if self is other: raise BondError('Cannot angle atom to itself') self._angle_partners.add(other) other._angle_partners.add(self)
def dihedral_to(self, other): """ Register this atom as dihedral partners. Cannot dihedral to itself. If that is attempted, a BondError is raised """ if self is other: raise BondError('Cannot dihedral atom to itself') self._dihedral_partners.add(other) other._dihedral_partners.add(self)
def bond_to(self, other): """ Register this atom as bonded partners. Cannot bond to itself. If that is attempted, a BondError is raised """ if self is other: raise BondError('Cannot bond atom to itself') self._bond_partners.add(other) other._bond_partners.add(self)