From 3d9b0dfc44d49034794a5566626c8c02f8cc96cd Mon Sep 17 00:00:00 2001
From: kohlhaasrebecca <rebecca.kohlhaas@outlook.com>
Date: Wed, 9 Oct 2024 12:17:21 +0200
Subject: [PATCH] [tests] Add some PCE PostProcessing tests

---
 .../post_processing/post_processing.py        | 43 +++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/src/bayesvalidrox/post_processing/post_processing.py b/src/bayesvalidrox/post_processing/post_processing.py
index 8300faebf..f87d00096 100644
--- a/src/bayesvalidrox/post_processing/post_processing.py
+++ b/src/bayesvalidrox/post_processing/post_processing.py
@@ -556,12 +556,21 @@ class PostProcessing:
 
         """
         # This function currently only supports PCE/aPCE
+<<<<<<< HEAD
         metamod = self.engine.MetaModel
         if not hasattr(metamod, 'meta_model_type'):
             raise AttributeError('Sobol indices only support PCE-type models!')
         if metamod.meta_model_type.lower() not in ['pce', 'apce']:
             raise AttributeError('Sobol indices only support PCE-type models!')
 
+=======
+        PCEModel = self.engine.MetaModel
+        if not hasattr(PCEModel, 'meta_model_type'):
+            raise AttributeError('Sobol indices only support PCE-type models!')
+        if PCEModel.meta_model_type.lower() not in ['pce', 'apce']:
+            raise AttributeError('Sobol indices only support PCE-type models!')
+            
+>>>>>>> 55b69984 ([tests] Add some PCE PostProcessing tests)
         # Extract the necessary variables
         basis_dict = metamod._basis_dict
         coeffs_dict = metamod._coeffs_dict
@@ -960,6 +969,7 @@ class PostProcessing:
             plt.close()
 
     # -------------------------------------------------------------------------
+<<<<<<< HEAD
     def plot_metamodel_3d(self, n_samples=10):
         """
         Visualize the results of a PCE MetaModel as a 3D surface over two input 
@@ -974,6 +984,18 @@ class PostProcessing:
         ------
         AttributeError
             This function is only applicable if the MetaModel input dimension is 2.
+=======
+    def eval_pce_model_3d(self):
+        # This function currently only supports PCE/aPCE
+        PCEModel = self.engine.MetaModel
+        if not hasattr(PCEModel, 'meta_model_type'):
+            raise AttributeError('This evaluation only support PCE-type models!')
+        if PCEModel.meta_model_type.lower() not in ['pce', 'apce']:
+            raise AttributeError('This evaluation only support PCE-type models!')
+
+        self.n_samples = 1000
+        n_samples = self.n_samples
+>>>>>>> 55b69984 ([tests] Add some PCE PostProcessing tests)
 
         Returns
         -------
@@ -1068,6 +1090,7 @@ class PostProcessing:
 
         """
         # This function currently only supports PCE/aPCE
+<<<<<<< HEAD
         metamod = self.engine.MetaModel
         if not hasattr(metamod, 'meta_model_type'):
             raise AttributeError(
@@ -1075,6 +1098,14 @@ class PostProcessing:
         if metamod.meta_model_type.lower() not in ['pce', 'apce']:
             raise AttributeError(
                 'This evaluation only support PCE-type models!')
+=======
+        PCEModel = self.engine.MetaModel
+        if not hasattr(PCEModel, 'meta_model_type'):
+            raise AttributeError('This evaluation only support PCE-type models!')
+        if PCEModel.meta_model_type.lower() not in ['pce', 'apce']:
+            raise AttributeError('This evaluation only support PCE-type models!')
+
+>>>>>>> 55b69984 ([tests] Add some PCE PostProcessing tests)
 
         # get the samples
         y_pce_val = self.pce_out_mean
@@ -1149,6 +1180,7 @@ class PostProcessing:
 
         """
         # This function currently only supports PCE/aPCE
+<<<<<<< HEAD
         metamod = self.engine.MetaModel
         if not hasattr(metamod, 'meta_model_type'):
             raise AttributeError(
@@ -1156,6 +1188,17 @@ class PostProcessing:
         if metamod.meta_model_type.lower() not in ['pce', 'apce']:
             raise AttributeError(
                 'This evaluation only support PCE-type models!')
+=======
+        PCEModel = self.engine.MetaModel
+        if not hasattr(PCEModel, 'meta_model_type'):
+            raise AttributeError('This evaluation only support PCE-type models!')
+        if PCEModel.meta_model_type.lower() not in ['pce', 'apce']:
+            raise AttributeError('This evaluation only support PCE-type models!')
+
+        newpath = f'Outputs_PostProcessing_{self.name}/'
+        if not os.path.exists(newpath):
+            os.makedirs(newpath)
+>>>>>>> 55b69984 ([tests] Add some PCE PostProcessing tests)
 
         # List of markers and colors
         color = cycle((['b', 'g', 'r', 'y', 'k']))
-- 
GitLab