.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OECanonicalOrderBonds

.. oe:function:: OECanonicalOrderBonds

   .. oe:language:: c++ java csharp

      .. oe:api::

         void OECanonicalOrderBonds(OEMolBase& mol)

   .. oe:language:: python

      .. oe:api:: python

         OECanonicalOrderBonds(mol: Union[OEGraphMol,OEMol,OEQMol]) -> None

   Reorders the bonds of a molecule canonically with respect to the
   current atom order.  This function uses the
   :oe:meth:`OEChem::OEMolBase::OrderBonds` method to change the order in
   which the iterator returned by :oe:meth:`OEChem::OEMolBase::GetBonds`
   and :oe:meth:`OEChem::OEAtomBase::GetBonds` traverses the
   bonds of a molecule.  This function does not affect the bond indices.

.. seealso::

  .. oe:language:: c++

      * Example program :ref:`cansmi.cpp<section_example_oechem_cansmi>`

  .. oe:language:: python

      * Example program :ref:`cansmi.py<section_example_oechem_cansmi>`

  .. oe:language:: java

      * Example program :ref:`CanSmi.java<section_example_oechem_cansmi>`

  .. oe:language:: csharp

      * Example program :ref:`CanSmi.cs<section_example_oechem_cansmi>`

