lightning_template.utils.progress.rich_progress
===============================================

.. py:module:: lightning_template.utils.progress.rich_progress


Classes
-------

.. autoapisummary::

   lightning_template.utils.progress.rich_progress.RichProgressBar


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

.. py:class:: RichProgressBar(show_version: Optional[bool] = False, show_eta_time: Optional[bool] = False, *args: Any, **kwargs: Any)

   Bases: :py:obj:`lightning.pytorch.callbacks.progress.rich_progress.RichProgressBar`


   Create a progress bar with `rich text formatting <https://github.com/Textualize/rich>`_.

   Install it with pip:

   .. code-block:: bash

       pip install rich

   .. code-block:: python

       from lightning.pytorch import Trainer
       from lightning.pytorch.callbacks import RichProgressBar

       trainer = Trainer(callbacks=RichProgressBar())

   :param refresh_rate: Determines at which rate (in number of batches) the progress bars get updated.
                        Set it to ``0`` to disable the display.
   :param leave: Leaves the finished progress bar in the terminal at the end of the epoch. Default: False
   :param theme: Contains styles used to stylize the progress bar.
   :param console_kwargs: Args for constructing a `Console`

   :raises ModuleNotFoundError: If required `rich` package is not installed on the device.

   .. note::

      PyCharm users will need to enable “emulate terminal” in output console option in
      run/debug configuration to see styled output.
      Reference: https://rich.readthedocs.io/en/latest/introduction.html#requirements


   .. py:attribute:: show_version
      :value: False



   .. py:attribute:: show_eta_time
      :value: False



   .. py:method:: on_train_start(trainer, pl_module)

      Called when the train begins.



   .. py:method:: get_metrics(trainer: lightning.pytorch.Trainer, pl_module: lightning.pytorch.LightningModule) -> Dict[str, Union[int, str]]

      Combines progress bar metrics collected from the trainer with standard metrics from get_standard_metrics.
      Implement this to override the items displayed in the progress bar.

      Here is an example of how to override the defaults:

      .. code-block:: python

          def get_metrics(self, trainer, model):
              # don't show the version number
              items = super().get_metrics(trainer, model)
              items.pop("v_num", None)
              return items

      :returns: Dictionary with the items to be displayed in the progress bar.



