Source code for thesis.core.output.progress

"""Progress tracking protocol for the thesis framework.

Provides a Protocol for node-level progress tracking that allows
different progress bar implementations to be used interchangeably.
"""

from __future__ import annotations

from typing import Protocol, runtime_checkable

__all__ = ["NodeProgressProtocol"]


[docs] @runtime_checkable class NodeProgressProtocol(Protocol): """Protocol for node-level progress tracking. Any class that implements ``node_started``, ``node_finished``, ``start``, and ``stop`` can be used as a node progress tracker. This allows Click's progressbar wrapper (``ClickNodeProgress``) to be used interchangeably. """
[docs] def start(self) -> None: """Start displaying the progress bar.""" ...
[docs] def stop(self) -> None: """Stop and clean up the progress bar.""" ...
[docs] def node_started(self, node_name: str) -> None: """Called when a node begins execution.""" ...
[docs] def node_finished(self, node_name: str, status: str = "") -> None: """Called when a node finishes execution.""" ...