From 845b5d62ed64e85e13fe7c45cbbebf23114ecca7 Mon Sep 17 00:00:00 2001 From: juacrumar Date: Tue, 7 May 2024 13:41:53 +0200 Subject: [PATCH 1/2] fix table chi2 grouped by --- validphys2/src/validphys/results.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/validphys2/src/validphys/results.py b/validphys2/src/validphys/results.py index 6c9e15a4b9..69eb3c397f 100644 --- a/validphys2/src/validphys/results.py +++ b/validphys2/src/validphys/results.py @@ -799,8 +799,13 @@ def groups_chi2_table(groups_data, pdf, groups_chi2, groups_each_dataset_chi2): for group, groupres, dsresults in zip(groups_data, groups_chi2, groups_each_dataset_chi2): for dataset, dsres in zip(group, dsresults): stats = chi2_stats(dsres) - stats["group"] = dataset.name + stats["dataset"] = dataset.name + stats["group"] = str(group) records.append(stats) + stats = chi2_stats(groupres) + stats["group"] = str(group) + stats["dataset"] = "" + records.append(stats) return pd.DataFrame(records) From 1a3b814f26338892755845c239b05fa989bb033f Mon Sep 17 00:00:00 2001 From: "Juan M. Cruz-Martinez" Date: Wed, 8 May 2024 17:40:56 +0200 Subject: [PATCH 2/2] Update validphys2/src/validphys/results.py Co-authored-by: Roy Stegeman --- validphys2/src/validphys/results.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validphys2/src/validphys/results.py b/validphys2/src/validphys/results.py index 69eb3c397f..e779b151df 100644 --- a/validphys2/src/validphys/results.py +++ b/validphys2/src/validphys/results.py @@ -804,7 +804,7 @@ def groups_chi2_table(groups_data, pdf, groups_chi2, groups_each_dataset_chi2): records.append(stats) stats = chi2_stats(groupres) stats["group"] = str(group) - stats["dataset"] = "" + stats["dataset"] = "Group Total" records.append(stats) return pd.DataFrame(records)