feat: add method to_steps to Performance

This commit is contained in:
Manuel Schmid
2024-05-30 00:20:53 +02:00
parent f8f2455b65
commit 1981ace9e1
+4
View File
@@ -152,6 +152,10 @@ class Performance(Enum):
def list(cls) -> list:
return list(map(lambda c: c.value, cls))
@classmethod
def by_steps(cls, steps: int | str):
return cls[Steps(int(steps)).name]
@classmethod
def has_restricted_features(cls, x) -> bool:
if isinstance(x, Performance):