From 67dac4687d0be2b9125dd815c18da0c516e8658e Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Tue, 2 Jul 2024 11:50:50 +0200 Subject: model JSON export: Include parameter values that contributed to this model --- lib/model.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/model.py b/lib/model.py index a221d47..2815830 100644 --- a/lib/model.py +++ b/lib/model.py @@ -625,11 +625,17 @@ class AnalyticModel: ret = { "parameters": self.parameters, "name": dict([[name, dict()] for name in self.names]), + "paramValuesbyName": dict([[name, dict()] for name in self.names]), } for name in self.names: for attr_name, attr in self.attr_by_name[name].items(): ret["name"][name][attr_name] = attr.to_json(**kwargs) + attr_name = list(self.attributes(name))[0] + for param_name in self.parameters: + ret["paramValuesbyName"][name][param_name] = self.attr_by_name[name][ + attr_name + ].stats.distinct_values_by_param_name[param_name] return ret -- cgit v1.2.3