From 6149acc535bd84c73434ea97c3ffcff7456b4e80 Mon Sep 17 00:00:00 2001 From: Jan Kwakkel Date: Fri, 15 Dec 2023 09:53:38 +0100 Subject: [PATCH] turn exception into depracatin wanring --- ema_workbench/em_framework/parameters.py | 4 ++++ ema_workbench/em_framework/util.py | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ema_workbench/em_framework/parameters.py b/ema_workbench/em_framework/parameters.py index 58c527d9b..a924dd3fc 100644 --- a/ema_workbench/em_framework/parameters.py +++ b/ema_workbench/em_framework/parameters.py @@ -42,6 +42,10 @@ def __set_name__(self, cls, name): self.name = name self.internal_name = "_" + name + @abc.abstractmethod + def get_bound(self, instance): + ... + class UpperBound(Bound): def get_bound(self, instance): diff --git a/ema_workbench/em_framework/util.py b/ema_workbench/em_framework/util.py index b117b123f..f854b9e2c 100644 --- a/ema_workbench/em_framework/util.py +++ b/ema_workbench/em_framework/util.py @@ -64,7 +64,9 @@ def variable_name(self, name): def __init__(self, name): if not name.isidentifier(): - raise ValueError(f"'{name}' is not a valid Python identifier.") + DeprecationWarning( + f"'{name}' is not a valid Python identifier. In future versions of the workbench, names must be valid python identifiers" + ) super().__init__(name)