diff --git a/src/bayesvalidrox/post_processing/post_processing.py b/src/bayesvalidrox/post_processing/post_processing.py index 8300faebf2aff0027b23b0f211191928376cfafe..f87d0009631684ac29376f6d6084f7473dc8afdb 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']))