From 5866e5d4c5c6b4d3d60d0c0af049ba7354cf83ee Mon Sep 17 00:00:00 2001 From: James Panayis Date: Mon, 22 Sep 2025 10:27:47 +0100 Subject: [PATCH] Update abort_on_alert Remove long-deprecated ability to pass bool and make literals consistent within code --- simvue/run.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/simvue/run.py b/simvue/run.py index 6c855524..c0904d78 100644 --- a/simvue/run.py +++ b/simvue/run.py @@ -23,7 +23,6 @@ import functools import platform import typing -import warnings import uuid import numpy import randomname @@ -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 @@ -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 @@ -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: