qq_lib.properties.job_type

Enumeration of supported qq job types.

This module defines JobType, an enum distinguishing between standard (single-run) qq jobs and loop jobs.

 1# Released under MIT License.
 2# Copyright (c) 2025-2026 Ladislav Bartos and Robert Vacha Lab
 3
 4"""
 5Enumeration of supported qq job types.
 6
 7This module defines `JobType`, an enum distinguishing between standard
 8(single-run) qq jobs and loop jobs.
 9"""
10
11from enum import Enum
12from typing import Self
13
14from qq_lib.core.error import QQError
15
16
17class JobType(Enum):
18    """
19    Type of the qq job.
20    """
21
22    STANDARD = 1
23    LOOP = 2
24    CONTINUOUS = 3
25
26    def __str__(self):
27        return self.name.lower()
28
29    @classmethod
30    def from_str(cls, s: str) -> Self:
31        """
32        Convert a string to the corresponding JobType enum variant.
33
34        Args:
35            s (str): String representation of the job type (case-insensitive).
36
37        Returns:
38            JobType variant.
39
40        Raises:
41            QQError if the string corresponds to no JobType.
42        """
43        try:
44            return cls[s.upper()]
45        except KeyError:
46            raise QQError(f"Could not recognize a job type '{s}'.")
class JobType(enum.Enum):
18class JobType(Enum):
19    """
20    Type of the qq job.
21    """
22
23    STANDARD = 1
24    LOOP = 2
25    CONTINUOUS = 3
26
27    def __str__(self):
28        return self.name.lower()
29
30    @classmethod
31    def from_str(cls, s: str) -> Self:
32        """
33        Convert a string to the corresponding JobType enum variant.
34
35        Args:
36            s (str): String representation of the job type (case-insensitive).
37
38        Returns:
39            JobType variant.
40
41        Raises:
42            QQError if the string corresponds to no JobType.
43        """
44        try:
45            return cls[s.upper()]
46        except KeyError:
47            raise QQError(f"Could not recognize a job type '{s}'.")

Type of the qq job.

STANDARD = <JobType.STANDARD: 1>
LOOP = <JobType.LOOP: 2>
CONTINUOUS = <JobType.CONTINUOUS: 3>
@classmethod
def from_str(cls, s: str) -> Self:
30    @classmethod
31    def from_str(cls, s: str) -> Self:
32        """
33        Convert a string to the corresponding JobType enum variant.
34
35        Args:
36            s (str): String representation of the job type (case-insensitive).
37
38        Returns:
39            JobType variant.
40
41        Raises:
42            QQError if the string corresponds to no JobType.
43        """
44        try:
45            return cls[s.upper()]
46        except KeyError:
47            raise QQError(f"Could not recognize a job type '{s}'.")

Convert a string to the corresponding JobType enum variant.

Arguments:
  • s (str): String representation of the job type (case-insensitive).
Returns:

JobType variant.

Raises:
  • QQError if the string corresponds to no JobType.