wulfric.Atom.type#

property

property Atom.type: str#

Type of an atom (i.e. Cr, Ni, ...).

Computed from the Atom.name automatically. If it is impossible to deduct the atom type based on the atom's name, then it is set to "X" (atom type is undefined). It is not meant to be specified directly, but rather encourage you to use meaningful name for atoms.

Returns:
typestr

Type of the atom.

Notes

If Atom.name contains several possible atom types of length 2 as substrings, then the type is equal to the first one found.

Examples

>>> from wulfric import Atom
>>> atom = Atom()
>>> atom.type
'X'
>>> atom.name = "Cr"
>>> atom.type
'Cr'
>>> atom.name = "Cr1"
>>> atom.type
'Cr'
>>> atom.name = "_3341Cr"
>>> atom.type
'Cr'
>>> atom.name = "cr"
>>> atom.type
'Cr'
>>> atom.name = "S"
>>> atom.type
'S'
>>> atom.name = "Se"
>>> atom.type
'Se'
>>> atom.name = "Sp"
>>> atom.type
'S'
>>> atom.name = "123a"
>>> atom.type
'X'