Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions simvue/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import functools
import platform
import typing
import warnings
import uuid
import numpy
import randomname
Expand Down Expand Up @@ -1065,7 +1064,7 @@ def config(
enable_emission_metrics: bool | None = None,
disable_resources_metrics: bool | None = None,
storage_id: str | None = None,
abort_on_alert: typing.Literal["run", "all", "ignore"] | bool | None = None,
abort_on_alert: typing.Literal["run", "terminate", "ignore"] | None = None,
) -> bool:
"""Optional configuration

Expand All @@ -1084,10 +1083,10 @@ def config(
disable monitoring of resource metrics
storage_id : str, optional
identifier of storage to use, by default None
abort_on_alert : Literal['ignore', run', 'terminate'], optional
abort_on_alert : Literal['ignore', 'terminate', 'ignore'], optional
whether to abort when an alert is triggered.
* run - current run is aborted.
* terminate - script itself is terminated.
* terminate - (default) script itself is terminated.
* ignore - alerts do not affect this run.

Returns
Expand Down Expand Up @@ -1153,11 +1152,12 @@ def config(

if abort_on_alert is not None:
if isinstance(abort_on_alert, bool):
warnings.warn(
"Use of type bool for argument 'abort_on_alert' will be deprecated from v1.2, "
"please use either 'run', 'all' or 'ignore'"
raise (
TypeError(
"Use of type bool for argument 'abort_on_alert' has been removed, "
"please use either 'run', 'all' or 'ignore'"
)
)
abort_on_alert = "run" if self._abort_on_alert else "ignore"
self._abort_on_alert = abort_on_alert

if storage_id:
Expand Down