radtools.Crystal.add_atom#

method

Crystal.add_atom(new_atom: Atom, relative=False)[source]#

Add atom to the crystall.

If new_atom```s literal and index are the same as of some atom of the crystal, then ``new_atom is not added.

If index of new_atom is not defined, it is set.

Parameters:
new_atomsAtom

New atom.

relativebool, default False

Whether new_atom position is in relative coordinates.

Raises:
TypeError

If new_atom is not an Atom.

ValueError

If the atom is already present in the crystal.