:mod:`sklearn_tournament.commons`
=================================

.. py:module:: sklearn_tournament.commons


Module Contents
---------------

Classes
~~~~~~~

.. autoapisummary::

   sklearn_tournament.commons.ItemsPerSecondColumn
   sklearn_tournament.commons.SecondsPerItemColumn



Functions
~~~~~~~~~

.. autoapisummary::

   sklearn_tournament.commons.install_rich
   sklearn_tournament.commons.jam_geomean
   sklearn_tournament.commons.list_compare
   sklearn_tournament.commons.iround
   sklearn_tournament.commons.round_to_first_significant
   sklearn_tournament.commons.round_to_first_significant_digits
   sklearn_tournament.commons.ema
   sklearn_tournament.commons.std_progress



Attributes
~~~~~~~~~~

.. autoapisummary::

   sklearn_tournament.commons.rc


.. data:: rc
   

   

.. function:: install_rich(conf: Optional[dict] = None) -> None


.. function:: jam_geomean(seq: Sequence[float]) -> float


.. function:: list_compare(a: Any, b: Any) -> bool


.. function:: iround(num: float) -> int


.. function:: round_to_first_significant(num: float, max_digits: int = 3) -> float


.. function:: round_to_first_significant_digits(num: float, digits: int = 1, max_digits: int = 3) -> float


.. function:: ema(x: float, mu: Optional[float] = None, alpha: float = 0.3) -> float

   Exponential moving average: smoothing to give progressively lower
   weights to older values.
   :param x: New value to include in EMA.
   :type x: float
   :param mu: Previous EMA value.
   :type mu: float, optional
   :param alpha: Smoothing factor in range [0, 1], [default: 0.3].
                 Increase to give more weight to recent values.
                 Ranges from 0 (yields mu) to 1 (yields x).
   :type alpha: float, optional


.. class:: ItemsPerSecondColumn


   Bases: :py:obj:`rich.progress.ProgressColumn`

   Base class for a widget to use in progress display.

   .. attribute:: max_refresh
      :annotation: = 0.5

      

   .. method:: render(self, task: rich.progress.Task) -> rich.text.Text

      Should return a renderable object.



.. class:: SecondsPerItemColumn


   Bases: :py:obj:`rich.progress.ProgressColumn`

   Base class for a widget to use in progress display.

   .. attribute:: max_refresh
      :annotation: = 0.5

      

   .. method:: render(self, task: rich.progress.Task) -> rich.text.Text

      Should return a renderable object.



.. function:: std_progress(console: Optional[rich.console.Console] = None) -> rich.progress.Progress


