From f0a055dfea8ed374a733ce3d28bcc0b4a8fc0a0d Mon Sep 17 00:00:00 2001
From: kohlhaasrebecca <rebecca.kohlhaas@outlook.com>
Date: Thu, 28 Nov 2024 13:47:23 +0100
Subject: [PATCH] Small changes and tests

---
 .../post_processing/post_processing.py        |  2 +-
 tests/test_PostProcessing.py                  | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/src/bayesvalidrox/post_processing/post_processing.py b/src/bayesvalidrox/post_processing/post_processing.py
index 12f09eed1..53d81f2a1 100644
--- a/src/bayesvalidrox/post_processing/post_processing.py
+++ b/src/bayesvalidrox/post_processing/post_processing.py
@@ -1027,7 +1027,7 @@ class PostProcessing:
             # (not including the constant term)
             # TODO: this should work without PCE-specific values
             length_list = []
-            for key, value in metamod._coeffs_dict["b_1"][key].items():
+            for _, value in metamod._coeffs_dict["b_1"][key].items():
                 length_list.append(len(value))
             n_predictors = min(length_list)
 
diff --git a/tests/test_PostProcessing.py b/tests/test_PostProcessing.py
index 7009d6c6c..c94e587af 100644
--- a/tests/test_PostProcessing.py
+++ b/tests/test_PostProcessing.py
@@ -229,6 +229,25 @@ def test_check_reg_quality_pce(pce_engine) -> None:
 #%% _get_sample
 #%% _eval_model
 #%% _plot_validation
+def test_plot_validation(pce_engine) -> None:
+    """
+    Check the regression quality for PCE metamodel
+    """
+    engine = pce_engine
+    post = PostProcessing(engine)
+    post.pce_out_mean, post.pce_out_std = engine.eval_metamodel([[0],[0.5]])
+    post.model_out_dict = {'Z': [[0.4],[0.3]]}
+    post._plot_validation()
+
+def test_plot_validation(gpe_engine) -> None:
+    """
+    Check the regression quality for PCE metamodel
+    """
+    engine = pce_engine
+    post = PostProcessing(engine)
+    post.pce_out_mean, post.pce_out_std = engine.eval_metamodel([[0],[0.5]])
+    post.model_out_dict = {'Z': [[0.4],[0.3]]}
+    post._plot_validation()
 
 #%% _plot_validation_multi
     
\ No newline at end of file
-- 
GitLab