From 5a7a03543379507f29d5af03110d94915a322b1c Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 24 Feb 2022 15:24:04 +0100 Subject: AnalyticFunction: catch dividy by zero errors and the likes --- lib/functions.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/functions.py b/lib/functions.py index 8e25ad3..69788df 100644 --- a/lib/functions.py +++ b/lib/functions.py @@ -722,7 +722,13 @@ class AnalyticFunction(ModelFunction): corresponds to lexically first parameter, etc. :param arg_list: argument values (list of float), if arguments are used. """ - return self._function(self.model_args, param_list) + try: + return self._function(self.model_args, param_list) + except FloatingPointError as e: + logger.error( + f"{e} when predicting {self._function_str}({param_list}), returning static value" + ) + return self.value def webconf_function_map(self): js_buf = self.model_function -- cgit v1.2.3