generated from MinBZK/python-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tasks for measures when creating an algorithm
- Loading branch information
1 parent
9b2dd45
commit 0787177
Showing
66 changed files
with
769 additions
and
286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from enum import IntEnum, StrEnum | ||
|
||
from amt.api.forms.measure import MeasureStatusOptions | ||
|
||
|
||
class Status(IntEnum): | ||
TODO = 1 | ||
IN_PROGRESS = 2 | ||
IN_REVIEW = 3 | ||
DONE = 4 | ||
NOT_IMPLEMENTED = 5 | ||
|
||
|
||
class TaskType(StrEnum): | ||
MEASURE = "measure" | ||
|
||
|
||
status_mapper: dict[Status, MeasureStatusOptions] = { | ||
Status.TODO: MeasureStatusOptions.TODO, | ||
Status.IN_PROGRESS: MeasureStatusOptions.IN_PROGRESS, | ||
Status.IN_REVIEW: MeasureStatusOptions.IN_REVIEW, | ||
Status.DONE: MeasureStatusOptions.DONE, | ||
Status.NOT_IMPLEMENTED: MeasureStatusOptions.NOT_IMPLEMENTED, | ||
} | ||
|
||
|
||
def measure_state_to_status(state: str) -> Status: | ||
return next((k for k, v in status_mapper.items() if v.value == state), Status.TODO) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.