Skip to content

Observer

Observer

Bases: ABC

Defines methods to show the status of the benchmark execution to the user.

Source code in asrbench\observer.py
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
class Observer(ABC):
    """Defines methods to show the status of the benchmark execution
    to the user."""

    @abstractmethod
    def start_progress(self) -> None:
        """Start progress execution."""
        raise NotImplementedError("Implement start_progress method.")

    @abstractmethod
    def update_progress(self, progress: float, message: str) -> None:
        """Updates execution progress.

        Parameters:
            progress:
            message:
        """
        raise NotImplementedError("Implement update_progress method.")

    @abstractmethod
    def notify(self, message: str) -> None:
        """Displays a message to the user."""
        raise NotImplementedError("Implement notify method.")

    @abstractmethod
    def finish(self) -> None:
        """Shows the finalization of progress."""
        raise NotImplementedError("Implement finish method.")

finish() abstractmethod

Shows the finalization of progress.

Source code in asrbench\observer.py
29
30
31
32
@abstractmethod
def finish(self) -> None:
    """Shows the finalization of progress."""
    raise NotImplementedError("Implement finish method.")

notify(message) abstractmethod

Displays a message to the user.

Source code in asrbench\observer.py
24
25
26
27
@abstractmethod
def notify(self, message: str) -> None:
    """Displays a message to the user."""
    raise NotImplementedError("Implement notify method.")

start_progress() abstractmethod

Start progress execution.

Source code in asrbench\observer.py
 9
10
11
12
@abstractmethod
def start_progress(self) -> None:
    """Start progress execution."""
    raise NotImplementedError("Implement start_progress method.")

update_progress(progress, message) abstractmethod

Updates execution progress.

Parameters:

Name Type Description Default
progress float
required
message str
required
Source code in asrbench\observer.py
14
15
16
17
18
19
20
21
22
@abstractmethod
def update_progress(self, progress: float, message: str) -> None:
    """Updates execution progress.

    Parameters:
        progress:
        message:
    """
    raise NotImplementedError("Implement update_progress method.")