From 1981ace9e14058c257cedef9774ff8b1cd2f495f Mon Sep 17 00:00:00 2001 From: Manuel Schmid Date: Thu, 30 May 2024 00:20:53 +0200 Subject: [PATCH] feat: add method to_steps to Performance --- modules/flags.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/flags.py b/modules/flags.py index cc191c92..25b0caae 100644 --- a/modules/flags.py +++ b/modules/flags.py @@ -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):