.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OESweepRotorCompressHydrogens

.. oe:function:: OESweepRotorCompressHydrogens

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

      .. oe:api::

         bool OESweepRotorCompressHydrogens(OEMCMolBase& mol,
                                            bool retainPolar = false,
                                            bool retainStereo = false,
                                            bool retainIsotope = true)

   .. oe:language:: python

      .. oe:api:: python

         OESweepRotorCompressHydrogens(mol: OEMol, retainPolar: bool = False,
                                       retainStereo: bool = False,
                                       retainIsotope: bool = True) -> bool

   Suppress hydrogens from a rotor-offset-compressed
   :ref:`OEMCMolBase <OEChem_OEMCMolBase>` in a way that does not corrupt the
   rotor compression data tables. Removing explicit hydrogens can have
   a dramatic improvement on the storage requirements of a molecule as
   hydrogen coordinates do not need to be stored anymore.

   The ``retainPolar``, ``retainStereo``, ``retainIsotope`` arguments
   are identical to the arguments passed to the
   :oe:func:`OEChem::OESuppressHydrogens` function and are forwarded
   to that function.

   Return ``false`` if an error like the following is detected: the
   molecule contains deleted atoms; or the rotor compression data is
   corrupted in some way. Return ``true`` if sweeping was successful
   and :oe:meth:`OEChem::OEMolBase::Sweep` was called on the
   molecule. Also return ``true`` if there were no hydrogens to sweep
   away at all and nothing was done.

   .. warning::

      The returned boolean value has a different meaning than
      :oe:func:`OEChem::OESuppressHydrogens` boolean return
      value. :oe:func:`OEChem::OESuppressHydrogens` will return
      ``false`` whenever a molecule does not contain hydrogens.
