Skip to content

status_message Module

Definition of a status update message in Spyral

StatusMessage dataclass

A status message to be emitted by a Phase

This is how we give progress updates.

Attributes:

Name Type Description
phase str

The phase name

increment int

The amount of progress we made

total int

The total progress size

run int

The current run number

Source code in src/spyral/core/status_message.py
@dataclass
class StatusMessage:
    """A status message to be emitted by a Phase

    This is how we give progress updates.

    Attributes
    ----------
    phase: str
        The phase name
    increment: int
        The amount of progress we made
    total: int
        The total progress size
    run: int
        The current run number

    """

    phase: str
    increment: int
    total: int
    run: int

    def __str__(self) -> str:
        return f"Run {self.run} | Task: {self.phase} |"