From e537dafe711dfbf1cc643442a55668bd285a3c6e Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 23 Feb 2021 08:28:49 +0100 Subject: analyze-archive: show substate model quality in table --- lib/model.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/model.py b/lib/model.py index 44272c8..e80d5a4 100644 --- a/lib/model.py +++ b/lib/model.py @@ -856,7 +856,21 @@ class PTAModel(AnalyticModel): return cumulative_energy / total_duration - return model_getter, param_info_getter + def info_getter(name, key, **kwargs): + if key != "power": + return None + + try: + substate_count = round(param_model_getter(name, "substate_count")) + except KeyError: + return None + if substate_count == 1: + return None + + # TODO + return True + + return model_getter, info_getter # This heuristic is very similar to the "function is not much better than # median" checks in get_fitted. So far, doing it here as well is mostly -- cgit v1.2.3