Skip to content

Enums


Package for providing enumerations for interfaces

State

Bases: Enum

Workflow step state enumeration.

Source code in maestrowf/abstracts/enums/__init__.py
class State(Enum):
    """Workflow step state enumeration."""

    INITIALIZED = 0
    PENDING = 1
    WAITING = 2
    RUNNING = 3
    FINISHING = 4
    FINISHED = 5
    QUEUED = 6
    FAILED = 7
    INCOMPLETE = 8
    HWFAILURE = 9
    TIMEDOUT = 10
    UNKNOWN = 11
    CANCELLED = 12
    NOTFOUND = 13
    DRYRUN = 14

StepPriority

Bases: Enum

Scheduler priority for submitted jobs

Source code in maestrowf/abstracts/enums/__init__.py
class StepPriority(Enum):
    """Scheduler priority for submitted jobs"""
    HELD = 0
    MINIMAL = 1
    LOW = 2
    MEDIUM = 3
    HIGH = 4
    EXPEDITE = 5

    @classmethod
    def from_str(cls, priority):
        _priority = priority.lower()

        if _priority == "held":
            return cls.HELD
        if _priority == "minimal":
            return cls.MINIMAL
        if _priority == "medium":
            return cls.MEDIUM
        if _priority == "high":
            return cls.HIGH
        if _priority == "expedite":
            return cls.EXPEDITE

        raise ValueError(f"Priority '{priority}' not valid.")

StudyStatus

Bases: Enum

Workflow status enumeration

Source code in maestrowf/abstracts/enums/__init__.py
class StudyStatus(Enum):
    """Workflow status enumeration"""
    FINISHED = 0   # The Study has finished successfully, all steps ran
    RUNNING = 1    # The Study is currently running
    FAILURE = 2    # The Study has finished, but 1 or more steps failed
    CANCELLED = 3  # The Study has finished, but was cancelled