Skip to content

Commit

Permalink
Post-processing refactoring (#4410)
Browse files Browse the repository at this point in the history
Co-authored-by: Massimo Capodiferro <[email protected]>
Co-authored-by: maxcapodi78 <Shark78>
Co-authored-by: Kathy Pippert <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
4 people authored Apr 4, 2024
1 parent 3012455 commit 6125897
Show file tree
Hide file tree
Showing 50 changed files with 1,262 additions and 1,401 deletions.
54 changes: 26 additions & 28 deletions _unittest/test_12_1_PostProcessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,25 +98,25 @@ def test_01_Animate_plt(self):
phases = [str(i * 5) + "deg" for i in range(2)]
model_gif = self.aedtapp.post.plot_animated_field(
quantity="Mag_E",
object_list=cutlist,
objects=cutlist,
plot_type="CutPlane",
setup_name=self.aedtapp.nominal_adaptive,
intrinsics={"Freq": "5GHz", "Phase": "0deg"},
export_path=self.local_scratch.path,
variation_variable="Phase",
variation_list=phases,
variations=phases,
show=False,
export_gif=True,
export_path=self.local_scratch.path,
)
assert os.path.exists(model_gif.gif_file)
setup_name = self.aedtapp.existing_analysis_sweeps[0]
intrinsic = {"Freq": "5GHz", "Phase": "180deg"}
pl1 = self.aedtapp.post.create_fieldplot_volume("NewObject_IJD39Q", "Mag_E", setup_name, intrinsic)
model_gif2 = self.aedtapp.post.animate_fields_from_aedtplt(
plotname=pl1.name,
plot_name=pl1.name,
plot_folder=None,
variation_variable="Phase",
variation_list=phases,
variations=phases,
project_path="",
export_gif=False,
show=False,
Expand All @@ -136,9 +136,7 @@ def test_02_export_fields(self):
plot2 = self.aedtapp.post.create_fieldplot_volume(vollist, quantity_name2, setup_name, intrinsic)

self.aedtapp.post.export_field_jpg(
os.path.join(self.local_scratch.path, "prova2.jpg"),
plot2.name,
plot2.plotFolder,
os.path.join(self.local_scratch.path, "prova2.jpg"), plot2.name, plot2.plot_folder
)
assert os.path.exists(os.path.join(self.local_scratch.path, "prova2.jpg"))
assert os.path.exists(
Expand Down Expand Up @@ -225,7 +223,7 @@ def test_07_export_fields_from_Calculator(self):
os.path.join(self.local_scratch.path, "Efield.fld"),
grid_stop=[5, 5, 5],
grid_step=[0.5, 0.5, 0.5],
isvector=True,
is_vector=True,
intrinsics="5GHz",
)
assert os.path.exists(os.path.join(self.local_scratch.path, "Efield.fld"))
Expand All @@ -235,10 +233,10 @@ def test_07_export_fields_from_Calculator(self):
"Setup1 : LastAdaptive",
self.aedtapp.available_variations.nominal_w_values_dict,
os.path.join(self.local_scratch.path, "MagEfieldSph.fld"),
gridtype="Spherical",
grid_type="Spherical",
grid_stop=[5, 300, 300],
grid_step=[5, 50, 50],
isvector=False,
is_vector=False,
intrinsics="5GHz",
)
assert os.path.exists(os.path.join(self.local_scratch.path, "MagEfieldSph.fld"))
Expand All @@ -248,10 +246,10 @@ def test_07_export_fields_from_Calculator(self):
"Setup1 : LastAdaptive",
self.aedtapp.available_variations.nominal_w_values_dict,
os.path.join(self.local_scratch.path, "MagEfieldCyl.fld"),
gridtype="Cylindrical",
grid_type="Cylindrical",
grid_stop=[5, 300, 5],
grid_step=[5, 50, 5],
isvector=False,
is_vector=False,
intrinsics="5GHz",
)
assert os.path.exists(os.path.join(self.local_scratch.path, "MagEfieldCyl.fld"))
Expand All @@ -271,12 +269,12 @@ def test_09_manipulate_report(self):
assert self.aedtapp.post.create_report("dB(S(1,1))")
assert self.aedtapp.post.create_report(
expressions="MaxMagDeltaS",
variations={"Pass": ["All"]},
setup_sweep_name="Setup1 : AdaptivePass",
variations={"Pass": ["All"]},
primary_sweep_variable="Pass",
report_category="Modal Solution Data",
plot_type="Rectangular Plot",
plotname="Solution Convergence Plot",
plot_name="Solution Convergence Plot",
)
new_report = self.aedtapp.post.reports_by_category.modal_solution("dB(S(1,1))")
assert new_report.create()
Expand Down Expand Up @@ -501,13 +499,13 @@ def test_14_Field_Ploton_cutplanedesignname(self):
assert plot1.update_field_plot_settings()
self.aedtapp.logger.info("Generating the image")
plot_obj = self.aedtapp.post.plot_field_from_fieldplot(
plotname=plot1.name,
plot_name=plot1.name,
project_path=self.local_scratch.path,
meshplot=False,
imageformat="jpg",
mesh_plot=False,
image_format="jpg",
view="xy",
show=False,
plot_label=plot1.name + " label",
show=False,
)
assert os.path.exists(plot_obj.image_file)
os.unlink(plot_obj.image_file)
Expand All @@ -526,13 +524,13 @@ def test_14_Field_Ploton_cutplanedesignname(self):
assert os.path.exists(plot_obj.image_file)

plot_obj = self.aedtapp.post.plot_field_from_fieldplot(
plotname=plot1.name,
plot_name=plot1.name,
project_path=self.local_scratch.path,
meshplot=False,
imageformat="jpg",
mesh_plot=False,
image_format="jpg",
view="xy",
show=False,
plot_label=plot1.name + " label",
show=False,
file_format="aedtplt",
)
assert os.path.exists(plot_obj.image_file)
Expand All @@ -557,11 +555,11 @@ def test_14B_Field_Ploton_Vector(self):
"CutPlane",
setup_name=setup_name,
intrinsics=intrinsic,
export_path=self.local_scratch.path,
mesh_on_fields=False,
imageformat="jpg",
view="isometric",
show=False,
export_path=self.local_scratch.path,
image_format="jpg",
)
assert os.path.exists(plot_obj.image_file)

Expand All @@ -580,11 +578,11 @@ def test_15_export_plot(self):
def test_16_create_field_plot(self):
cutlist = ["Global:XY"]
plot = self.aedtapp.post._create_fieldplot(
objlist=cutlist,
quantityName="Mag_E",
objects=cutlist,
quantity="Mag_E",
setup_name=self.aedtapp.nominal_adaptive,
intrinsics={},
listtype="CutPlane",
list_type="CutPlane",
)
assert plot

Expand Down
Loading

0 comments on commit 6125897

Please sign in to comment.