radtools.Crystal.remove_atom#

method

Crystal.remove_atom(atom: Atom | str, index=None)[source]#

Remove atom from the crystal.

If type(atom) == str, then all atoms with the name atom are removed if index == None or only atom with the name atom and index index is removed.

It type(atom) == Atom, index is ignored.

Parameters:
atomAtom or str

:py:class`.Atom` object or atom`s name. If name, then it has to be unique among atoms of the crystal.

indexoptional

Index of the atom.

Raises:
ValueError

If no match is found.