Coverage for src/sparkle/types/status.py: 100%
20 statements
« prev ^ index » next coverage.py v7.16.0, created at 2026-09-08 12:00 +0000
« prev ^ index » next coverage.py v7.16.0, created at 2026-09-08 12:00 +0000
1"""Class for solver status."""
3from __future__ import annotations
4from enum import Enum
7class DataFileLock(Enum):
8 """Indicates which CSV data file a job will write to."""
10 PERFORMANCE = "PERFORMANCE_DATA" # performance_dataframe.csv
11 FEATURE = "FEATURE_DATA" # feature_dataframe.csv
14class SolverStatus(str, Enum):
15 """Possible return states for solver runs."""
17 SUCCESS = "SUCCESS" # Positive status
18 SAT = "SAT" # SAT specific positive status
19 UNSAT = "UNSAT" # SAT specific positive status
21 # Negative status
22 UNKNOWN = "UNKNOWN"
23 CRASHED = "CRASHED"
24 TIMEOUT = "TIMEOUT"
25 WRONG = "WRONG"
26 ERROR = "ERROR"
27 KILLED = "KILLED"
29 def __str__(self: SolverStatus) -> str:
30 """Return the string value of the SolverStatus."""
31 return str(self.value)
33 @property
34 def positive(self: SolverStatus) -> bool:
35 """Return whether the status is positive."""
36 return self in [SolverStatus.SUCCESS, SolverStatus.SAT, SolverStatus.UNSAT]