From 9c27b0fe57cf05ccfe02f37a1e8ecf6a0bee2e16 Mon Sep 17 00:00:00 2001
From: kohlhaasrebecca <rebecca.kohlhaas@outlook.com>
Date: Wed, 27 Nov 2024 10:16:24 +0100
Subject: [PATCH] Add deprecation warning for PostProcessing._plot_validation

---
 .../post_processing/post_processing.py        | 30 +++++++++----------
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/src/bayesvalidrox/post_processing/post_processing.py b/src/bayesvalidrox/post_processing/post_processing.py
index 7c8a3706e..12f09eed1 100644
--- a/src/bayesvalidrox/post_processing/post_processing.py
+++ b/src/bayesvalidrox/post_processing/post_processing.py
@@ -5,6 +5,7 @@ Collection of postprocessing functions into a class.
 """
 
 import os
+import warnings
 from itertools import combinations, cycle
 import numpy as np
 import pandas as pd
@@ -216,15 +217,17 @@ class PostProcessing:
         """
         if samples is None:
             samples = self.engine.ExpDesign.generate_samples(
-            n_samples, sampling_method="random"
-        )
+                n_samples, sampling_method="random"
+            )
         else:
             n_samples = samples.shape[0]
 
         if model_out_dict is not None:
             self.model_out_dict = model_out_dict
         else:
-            self.model_out_dict, _ = self.engine.Model.run_model_parallel(samples, key_str="valid")
+            self.model_out_dict, _ = self.engine.Model.run_model_parallel(
+                samples, key_str="valid"
+            )
         self.pce_out_mean, self.pce_out_std = self.engine.eval_metamodel(samples)
 
         self._plot_validation_multi()
@@ -276,8 +279,8 @@ class PostProcessing:
         # Generate random samples if necessary
         if samples is None:
             samples = self.engine.ExpDesign.generate_samples(
-            n_samples, sampling_method="random"
-        )
+                n_samples, sampling_method="random"
+            )
 
         # Run the original model with the generated samples
         if outputs is None:
@@ -826,8 +829,8 @@ class PostProcessing:
         """
         if samples is None:
             samples = self.engine.ExpDesign.generate_samples(
-            n_samples, sampling_method="random"
-        )
+                n_samples, sampling_method="random"
+            )
         else:
             n_samples = samples.shape[0]
 
@@ -991,6 +994,10 @@ class PostProcessing:
         None.
 
         """
+        warnings.warn(
+            "This function will be deprecated in the future! Use PostProcessing._plot_validation_multi() instead!",
+            DeprecationWarning,
+        )
         # This function currently only supports PCE/aPCE
         metamod = self.engine.MetaModel
         if not hasattr(metamod, "meta_model_type"):
@@ -1035,19 +1042,14 @@ class PostProcessing:
                 xy=(0.05, 0.85),
                 xycoords="axes fraction",
             )
-
             plt.ylabel("Original Model")
             plt.xlabel("PCE Model")
             plt.grid()
-
-            # save the current figure
             plot_name = key.replace(" ", "_")
             fig.savefig(
                 f"./{self.out_dir}/Model_vs_PCEModel_{plot_name}.{self.out_format}",
                 bbox_inches="tight",
             )
-
-            # Destroy the current plot
             plt.close()
 
     # -------------------------------------------------------------------------
@@ -1067,10 +1069,6 @@ class PostProcessing:
         ------
         AttributeError: This evaluation only support PCE-type models!
 
-        Raises
-        ------
-        AttributeError: This evaluation only support PCE-type models!
-
         Returns
         -------
         None.
-- 
GitLab