.. _py-Chem: ********************************************************** Chem ********************************************************** .. default-domain:: py .. py:currentmodule:: mod .. cpp:namespace:: mod Class ``AtomId`` -------------------------------------------------------------------------------------------------------------------------------- .. py:class:: AtomId Representation of the chemical element of an atom. .. py:method:: __init__(self, id=AtomIds.Invalid) Construct an atom ID from an integer. :param int id: the atomic number to construct from, or :py:const:`AtomIds.Invalid` to explicitly signal an invalid atom. Must be at most the same value as :py:const:`AtomIds.Max`. .. py:attribute:: symbol (Read-only) The symbol represented by the atom id. :type: str :raises: :py:class:`LogicError` if the id is invalid. .. py:method:: __int__(self) Implicit conversion to an integer type. Class ``Isotope`` -------------------------------------------------------------------------------------------------------------------------------- .. py:class:: Isotope Representation of the isotope of an atom. .. py:method:: __init__(self) __init__(self, 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. .. py:method:: __int__(self) Implicit conversion to an integer type. Class ``Charge`` -------------------------------------------------------------------------------------------------------------------------------- .. py:class:: Charge Representation of the charge of an atom. .. py:method:: __init__(self, c=0) Construct a charge. :param int c: The charge to construct. Must be in the range :math:`[-9, 9]`. .. py:method:: __int__(self) Implicit conversion to an integer type. Class ``AtomData`` -------------------------------------------------------------------------------------------------------------------------------- .. py:class:: AtomData Representation of basic data of an atom. .. py:method:: __init__(self, atomId=AtomIds.Invalid, istotope=Isotope(), charge=Charge(), radical=False) Construct an atom data object. .. py:attribute:: atomId (Read-only) The atom id. :type: AtomId .. py:attribute:: isotope (Read-only) The isotope. :type: Isotope .. py:attribute:: charge (Read-only) The charge. :type: Charge .. py::attribute:: radical (Read-only) The radical. :type: bool .. py::method:: __str__(self) :returns: A string representation of the atom data adhering to the string encoding of atoms (see :ref:`mol-enc`). :raises: :py::class:`LogicError` if the atom id is :py:const:`AtomIds.Invalid`. Class ``BondType`` -------------------------------------------------------------------------------------------------------------------------------- .. py:class:: BondType Representation of a bond type. .. py:attribute:: Invalid .. py:attribute:: Single .. py:attribute:: Aromatic .. py:attribute:: Double .. py:attribute:: Triple .. py:method:: __str__(self) :returns: A string representation of the bond type adhering to the string encoding of bonds (see :ref:`mol-enc`). :raises: :py:class:`LogicError` if the bond type is :py:const:`Invalid`. Class ``AtomIds`` -------------------------------------------------------------------------------------------------------------------------------- .. py: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. .. py:attribute:: Invalid Constant for the invalid atom id. :type: AtomId .. py:attribute:: Max An atom id equal to the atom id with the maximum valid id. :type: AtomId