From fb0cfb734016d2617760438000419ce7315074f7 Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Thu, 23 May 2024 10:51:01 +0200 Subject: [PATCH] TESTS: Remove show arg from plot tests --- _unittest/test_02_2D_modeler.py | 5 ++--- _unittest/test_12_1_PostProcessing.py | 11 ++--------- _unittest/test_12_PostProcessing.py | 19 +++++-------------- 3 files changed, 9 insertions(+), 26 deletions(-) diff --git a/_unittest/test_02_2D_modeler.py b/_unittest/test_02_2D_modeler.py index f4985110b52..bfdc97894f0 100644 --- a/_unittest/test_02_2D_modeler.py +++ b/_unittest/test_02_2D_modeler.py @@ -167,15 +167,14 @@ def test_09_plot(self): position=[0, 0, 0], start_point=[0, 0, 2], num_sides=3, name="MyPolygon", material="Copper" ) obj = self.aedtapp.plot( - show=False, export_path=os.path.join(self.local_scratch.path, "image.jpg"), show_bounding=True, show_grid=True, ) assert os.path.exists(obj.image_file) - obj2 = self.aedtapp.plot(show=False, export_path=os.path.join(self.local_scratch.path, "image.jpg"), view="xy") + obj2 = self.aedtapp.plot(export_path=os.path.join(self.local_scratch.path, "image.jpg"), view="xy") assert os.path.exists(obj2.image_file) - obj3 = self.aedtapp.plot(show=False, export_path=os.path.join(self.local_scratch.path, "image.jpg"), view="xy1") + obj3 = self.aedtapp.plot(export_path=os.path.join(self.local_scratch.path, "image.jpg"), view="xy1") assert filecmp.cmp(obj.image_file, obj3.image_file) def test_10_edit_menu_commands(self): diff --git a/_unittest/test_12_1_PostProcessing.py b/_unittest/test_12_1_PostProcessing.py index addd18ff579..33eb6408a51 100644 --- a/_unittest/test_12_1_PostProcessing.py +++ b/_unittest/test_12_1_PostProcessing.py @@ -112,7 +112,6 @@ def test_01_Animate_plt(self): intrinsics={"Freq": "5GHz", "Phase": "0deg"}, variation_variable="Phase", variations=phases, - show=False, export_gif=True, export_path=self.local_scratch.path, ) @@ -127,7 +126,6 @@ def test_01_Animate_plt(self): variations=phases, project_path="", export_gif=False, - show=False, ) model_gif2.gif_file = os.path.join(self.aedtapp.working_directory, "test2.gif") model_gif2.camera_position = [0, 50, 200] @@ -514,7 +512,6 @@ def test_14_Field_Ploton_cutplanedesignname(self): image_format="jpg", view="xy", plot_label=plot1.name + " label", - show=False, ) assert os.path.exists(plot_obj.image_file) os.unlink(plot_obj.image_file) @@ -539,7 +536,6 @@ def test_14_Field_Ploton_cutplanedesignname(self): image_format="jpg", view="xy", plot_label=plot1.name + " label", - show=False, file_format="aedtplt", ) assert os.path.exists(plot_obj.image_file) @@ -566,7 +562,6 @@ def test_14B_Field_Ploton_Vector(self): intrinsics=intrinsic, mesh_on_fields=False, view="isometric", - show=False, export_path=self.local_scratch.path, image_format="jpg", ) @@ -574,12 +569,10 @@ def test_14B_Field_Ploton_Vector(self): @pytest.mark.skipif(is_linux or sys.version_info < (3, 8), reason="Not running in ironpython") def test_15_export_plot(self): - obj = self.aedtapp.post.plot_model_obj( - show=False, export_path=os.path.join(self.local_scratch.path, "image.jpg") - ) + obj = self.aedtapp.post.plot_model_obj(export_path=os.path.join(self.local_scratch.path, "image.jpg")) assert os.path.exists(obj.image_file) obj2 = self.aedtapp.post.plot_model_obj( - show=False, export_path=os.path.join(self.local_scratch.path, "image2.jpg"), plot_as_separate_objects=False + export_path=os.path.join(self.local_scratch.path, "image2.jpg"), plot_as_separate_objects=False ) assert os.path.exists(obj2.image_file) diff --git a/_unittest/test_12_PostProcessing.py b/_unittest/test_12_PostProcessing.py index 2375a7e7acb..ea1f6212e35 100644 --- a/_unittest/test_12_PostProcessing.py +++ b/_unittest/test_12_PostProcessing.py @@ -415,7 +415,7 @@ def test_55_time_plot(self, sbr_test): ) assert os.path.exists(frames_list) sbr_test.post.plot_scene( - frames_list, os.path.join(sbr_test.working_directory, "animation.gif"), norm_index=5, dy_rng=35, show=False + frames_list, os.path.join(sbr_test.working_directory, "animation.gif"), norm_index=5, dy_rng=35 ) assert os.path.exists(os.path.join(sbr_test.working_directory, "animation.gif")) sbr_test.post.plot_scene( @@ -423,7 +423,6 @@ def test_55_time_plot(self, sbr_test): os.path.join(sbr_test.working_directory, "animation2.gif"), norm_index=5, dy_rng=35, - show=False, convert_fields_in_db=True, log_multiplier=20.0, ) @@ -605,23 +604,22 @@ def test_70_far_field_data(self): img3 = os.path.join(self.local_scratch.path, "ff_2d2.jpg") ffdata.plot_2d_cut(image_path=img3) assert os.path.exists(img3) - curve_2d = ffdata.plot_2d_cut(show=False) + curve_2d = ffdata.plot_2d_cut() assert len(curve_2d[0]) == 3 - data = ffdata.polar_plot_3d(show=False) + data = ffdata.polar_plot_3d() assert len(data) == 3 img4 = os.path.join(self.local_scratch.path, "ff_3d1.jpg") ffdata.polar_plot_3d_pyvista( quantity="RealizedGain", image_path=img4, - show=False, background=[255, 0, 0], show_geometry=False, convert_to_db=True, ) assert os.path.exists(img4) data_pyvista = ffdata.polar_plot_3d_pyvista( - quantity="RealizedGain", show=False, background=[255, 0, 0], show_geometry=False, convert_to_db=True + quantity="RealizedGain", background=[255, 0, 0], show_geometry=False, convert_to_db=True ) assert data_pyvista @@ -637,7 +635,6 @@ def test_71_antenna_plot(self, field_test): title="Contour at {}Hz".format(ffdata.frequency), image_path=os.path.join(self.local_scratch.path, "contour.jpg"), convert_to_db=True, - show=False, ) assert os.path.exists(os.path.join(self.local_scratch.path, "contour.jpg")) @@ -667,13 +664,12 @@ def test_71_antenna_plot(self, field_test): ffdata.polar_plot_3d_pyvista( quantity="RealizedGain", image_path=os.path.join(self.local_scratch.path, "3d2.jpg"), - show=False, convert_to_db=True, ) assert os.path.exists(os.path.join(self.local_scratch.path, "3d2.jpg")) try: - p = ffdata.polar_plot_3d_pyvista(quantity="RealizedGain", show=False, convert_to_db=True) + p = ffdata.polar_plot_3d_pyvista(quantity="RealizedGain", convert_to_db=True) assert isinstance(p, object) except Exception: assert True @@ -687,7 +683,6 @@ def test_72_antenna_plot(self, array_test): title="Contour at {}Hz".format(ffdata.frequency), image_path=os.path.join(self.local_scratch.path, "contour.jpg"), convert_to_db=True, - show=False, ) assert os.path.exists(os.path.join(self.local_scratch.path, "contour.jpg")) @@ -697,7 +692,6 @@ def test_72_antenna_plot(self, array_test): secondary_sweep_value=[-180, -75, 75], title="Azimuth at {}Hz".format(ffdata.frequency), image_path=os.path.join(self.local_scratch.path, "2d1.jpg"), - show=False, ) assert os.path.exists(os.path.join(self.local_scratch.path, "2d1.jpg")) ffdata.plot_2d_cut( @@ -706,7 +700,6 @@ def test_72_antenna_plot(self, array_test): secondary_sweep_value=30, title="Azimuth at {}Hz".format(ffdata.frequency), image_path=os.path.join(self.local_scratch.path, "2d2.jpg"), - show=False, ) assert os.path.exists(os.path.join(self.local_scratch.path, "2d2.jpg")) @@ -719,7 +712,6 @@ def test_72_antenna_plot(self, array_test): ffdata.polar_plot_3d_pyvista( quantity="RealizedGain", image_path=os.path.join(self.local_scratch.path, "3d2.jpg"), - show=False, convert_to_db=True, ) assert os.path.exists(os.path.join(self.local_scratch.path, "3d2.jpg")) @@ -729,7 +721,6 @@ def test_72_antenna_plot(self, array_test): title="Contour at {}Hz".format(ffdata1.frequency), image_path=os.path.join(self.local_scratch.path, "contour1.jpg"), convert_to_db=True, - show=False, ) assert os.path.exists(os.path.join(self.local_scratch.path, "contour1.jpg"))