From 5c38f8cca410464cb24e45a52e64409debd81769 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Fri, 9 Feb 2024 08:17:07 +0100 Subject: from_json: Support models without argCount and value --- lib/functions.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/functions.py b/lib/functions.py index 9cc7a99..8df15de 100644 --- a/lib/functions.py +++ b/lib/functions.py @@ -518,7 +518,9 @@ class ScalarSplitFunction(ModelFunction): assert data["type"] == "scalarSplit" left = ModelFunction.from_json(data["left"]) right = ModelFunction.from_json(data["right"]) - self = cls(data["value"], data["paramIndex"], data["threshold"], left, right) + self = cls( + data.get("value", 0), data["paramIndex"], data["threshold"], left, right + ) return self @@ -1277,10 +1279,10 @@ class AnalyticFunction(ModelFunction): assert data["type"] == "analytic" return cls( - data["value"], + data.get("value", 0), data["functionStr"], data["parameterNames"], - data["argCount"], + data.get("argCount", 0), data["regressionModel"], ) -- cgit v1.2.3