| Total Complexity | 1 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | from abc import ABC, abstractmethod |
||
| 2 | from typing import TypeVar, Generic |
||
| 3 | |||
| 4 | T = TypeVar('T') |
||
| 5 | |||
| 6 | |||
| 7 | class TerminationConditionInterface(ABC, Generic[T]): |
||
| 8 | """A condition that evaluates to True or False. |
||
| 9 | |||
| 10 | If True it should indicate that something should now terminate. |
||
| 11 | """ |
||
| 12 | @abstractmethod |
||
| 13 | def satisfied(self, progress: T) -> bool: |
||
| 14 | """Check if the termination condition is True. |
||
| 15 | |||
| 16 | Args: |
||
| 17 | progress ([type]): [description] |
||
| 18 | |||
| 19 | Returns: |
||
| 20 | bool: True if the termination condition is satisfied, else False |
||
| 21 | """ |
||
| 22 | raise NotImplementedError |
||
| 23 |