Skip to content

Commit 01c20ca

Browse files
committed
Add notification option to run init
1 parent 56cead2 commit 01c20ca

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

simvue/run.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,7 @@ def init(
565565
folder: typing.Annotated[
566566
str, pydantic.Field(None, pattern=FOLDER_REGEX)
567567
] = None,
568+
notification: typing.Literal["none", "all", "error", "lost"] = "none",
568569
running: bool = True,
569570
retention_period: str | None = None,
570571
timeout: int | None = 180,
@@ -586,6 +587,9 @@ def init(
586587
description of the run, by default None
587588
folder : str, optional
588589
folder within which to store the run, by default "/"
590+
notification: typing.Literal["none", "all", "error", "lost"], optional
591+
whether to notify the user by email upon completion of the run if
592+
the run is in the specified state, by default "none"
589593
running : bool, optional
590594
whether to set the status as running or created, the latter implying
591595
the run will be commenced at a later time. Default is True.
@@ -686,6 +690,7 @@ def init(
686690
self._sv_obj.tags = tags
687691
self._sv_obj.metadata = (metadata or {}) | git_info(os.getcwd()) | environment()
688692
self._sv_obj.heartbeat_timeout = timeout
693+
self._sv_obj.notifications = notification
689694

690695
if self._status == "running":
691696
self._sv_obj.system = get_system()

0 commit comments

Comments
 (0)