diff --git a/src/bayesvalidrox/post_processing/post_processing.py b/src/bayesvalidrox/post_processing/post_processing.py index e13ebf62d54febdd8bbb5bd459e1563a83d1a703..3e75c08b16b449a353c4ea4c57d64b64f9601706 100644 --- a/src/bayesvalidrox/post_processing/post_processing.py +++ b/src/bayesvalidrox/post_processing/post_processing.py @@ -563,21 +563,12 @@ 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!') - ->>>>>>> a58a509a ([tests] Add some PCE PostProcessing tests) # Extract the necessary variables basis_dict = metamod._basis_dict coeffs_dict = metamod._coeffs_dict @@ -975,7 +966,6 @@ 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 @@ -990,18 +980,6 @@ 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 ->>>>>>> a58a509a ([tests] Add some PCE PostProcessing tests) Returns ------- @@ -1096,7 +1074,6 @@ class PostProcessing: """ # This function currently only supports PCE/aPCE -<<<<<<< HEAD metamod = self.engine.MetaModel if not hasattr(metamod, 'meta_model_type'): raise AttributeError( @@ -1104,14 +1081,6 @@ 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!') - ->>>>>>> a58a509a ([tests] Add some PCE PostProcessing tests) # get the samples y_pce_val = self.pce_out_mean @@ -1190,7 +1159,6 @@ class PostProcessing: """ # This function currently only supports PCE/aPCE -<<<<<<< HEAD metamod = self.engine.MetaModel if not hasattr(metamod, 'meta_model_type'): raise AttributeError( @@ -1198,17 +1166,6 @@ 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) ->>>>>>> a58a509a ([tests] Add some PCE PostProcessing tests) # List of markers and colors color = cycle((['b', 'g', 'r', 'y', 'k'])) diff --git a/tests/test_PostProcessing.py b/tests/test_PostProcessing.py index 47de2f8a4f11caddfc062c0785cafc50881baaaa..64cc615332d3b3252767878d4d26b1fe52946aac 100644 --- a/tests/test_PostProcessing.py +++ b/tests/test_PostProcessing.py @@ -149,7 +149,6 @@ def test_sobol_indices_pce(pce_engine) -> None: assert sobol['Z'][0,0] == 1 #%% check_reg_quality -<<<<<<< HEAD def test_check_reg_quality_pce(pce_engine) -> None: """ @@ -159,27 +158,16 @@ def test_check_reg_quality_pce(pce_engine) -> None: post = PostProcessing(engine) post.check_reg_quality(samples=engine.ExpDesign.X, outputs=engine.ExpDesign.Y) -#%% eplot_metamodel_3d - +#%% plot_metamodel_3d def test_plot_metamodel_3d_nopce(basic_engine) -> None: -======= -#%% eval_pce_model_3d - -def test_eval_pce_model_3d_nopce(basic_engine) -> None: ->>>>>>> a58a509a ([tests] Add some PCE PostProcessing tests) """ 3d eval of non-PCE metamodel """ engine = basic_engine post = PostProcessing(engine) with pytest.raises(AttributeError) as excinfo: -<<<<<<< HEAD post.plot_metamodel_3d() assert str(excinfo.value) == 'This function is only applicable if the MetaModel input dimension is 2.' -======= - post.eval_pce_model_3d() - assert str(excinfo.value) == 'This evaluation only support PCE-type models!' ->>>>>>> a58a509a ([tests] Add some PCE PostProcessing tests) #%% _get_sample