.. _py-Chem: ********************************************************** Chem ********************************************************** .. default-domain:: py .. py:currentmodule:: mod .. cpp:namespace:: mod .. class:: AtomId Representation of the chemical element of an atom. .. method:: __init__(id=AtomIds.Invalid) Construct an atom ID from an integer. :param int id: the atomic number to construct from, or :const:`AtomIds.Invalid` to explicitly signal an invalid atom. Must be at most the same value as :const:`AtomIds.Max`. .. attribute:: symbol (Read-only) The symbol represented by the atom id. :type: str :raises: :class:`LogicError` if the id is invalid. .. method:: __int__() Implicit conversion to an integer type. .. class:: Isotope Representation of the isotope of an atom. .. method:: __init__() __init__(i) Construct a representation of an isotope. If an isotope number is given, that specific one is constructed, otherwise the most abundant one is implicitly constructed. .. note:: There is a difference between constructing the most abundant isotope implicitly and explicitly. :param int i: An isotope number for explicit construction. Passing -1 is equivalent to default-construction. The number must be either -1 or at least 1. .. method:: __int__() Implicit conversion to an integer type. .. class:: Charge Representation of the charge of an atom. .. method:: __init__(c=0) Construct a charge. :param int c: The charge to construct. Must be in the range :math:`[-9, 9]`. .. method:: __int__() Implicit conversion to an integer type. .. class:: AtomData Representation of basic data of an atom. .. method:: __init__(atomId=AtomIds.Invalid, isotope=Isotope(), charge=Charge(), radical=False) Construct an atom data object. .. attribute:: atomId (Read-only) The atom id. :type: AtomId .. attribute:: isotope (Read-only) The isotope. :type: Isotope .. attribute:: charge (Read-only) The charge. :type: Charge .. :attribute:: radical (Read-only) The radical. :type: bool .. :method:: __str__() :returns: A string representation of the atom data adhering to the string encoding of atoms (see :ref:`mol-enc`). :raises: ::class:`LogicError` if the atom id is :const:`AtomIds.Invalid`. .. class:: BondType Representation of a bond type. .. attribute:: Invalid .. attribute:: Single .. attribute:: Aromatic .. attribute:: Double .. attribute:: Triple .. method:: __str__() :returns: A string representation of the bond type adhering to the string encoding of bonds (see :ref:`mol-enc`). :raises: :class:`LogicError` if the bond type is :const:`Invalid`. .. class:: AtomIds This class contains constants for each chemical element, both as their abbreviations and their full names. Two additional constants are provided for convenience. .. attribute:: Invalid Constant for the invalid atom id. :type: AtomId .. attribute:: Max An atom id equal to the atom id with the maximum valid id. :type: AtomId