Skip to content

Commit 6125897

Browse files
gmalinvemaxcapodi78PipKatpre-commit-ci[bot]
authored
Post-processing refactoring (#4410)
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>
1 parent 3012455 commit 6125897

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1262
-1401
lines changed

_unittest/test_12_1_PostProcessing.py

+26-28
Original file line numberDiff line numberDiff line change
@@ -98,25 +98,25 @@ def test_01_Animate_plt(self):
9898
phases = [str(i * 5) + "deg" for i in range(2)]
9999
model_gif = self.aedtapp.post.plot_animated_field(
100100
quantity="Mag_E",
101-
object_list=cutlist,
101+
objects=cutlist,
102102
plot_type="CutPlane",
103103
setup_name=self.aedtapp.nominal_adaptive,
104104
intrinsics={"Freq": "5GHz", "Phase": "0deg"},
105-
export_path=self.local_scratch.path,
106105
variation_variable="Phase",
107-
variation_list=phases,
106+
variations=phases,
108107
show=False,
109108
export_gif=True,
109+
export_path=self.local_scratch.path,
110110
)
111111
assert os.path.exists(model_gif.gif_file)
112112
setup_name = self.aedtapp.existing_analysis_sweeps[0]
113113
intrinsic = {"Freq": "5GHz", "Phase": "180deg"}
114114
pl1 = self.aedtapp.post.create_fieldplot_volume("NewObject_IJD39Q", "Mag_E", setup_name, intrinsic)
115115
model_gif2 = self.aedtapp.post.animate_fields_from_aedtplt(
116-
plotname=pl1.name,
116+
plot_name=pl1.name,
117117
plot_folder=None,
118118
variation_variable="Phase",
119-
variation_list=phases,
119+
variations=phases,
120120
project_path="",
121121
export_gif=False,
122122
show=False,
@@ -136,9 +136,7 @@ def test_02_export_fields(self):
136136
plot2 = self.aedtapp.post.create_fieldplot_volume(vollist, quantity_name2, setup_name, intrinsic)
137137

138138
self.aedtapp.post.export_field_jpg(
139-
os.path.join(self.local_scratch.path, "prova2.jpg"),
140-
plot2.name,
141-
plot2.plotFolder,
139+
os.path.join(self.local_scratch.path, "prova2.jpg"), plot2.name, plot2.plot_folder
142140
)
143141
assert os.path.exists(os.path.join(self.local_scratch.path, "prova2.jpg"))
144142
assert os.path.exists(
@@ -225,7 +223,7 @@ def test_07_export_fields_from_Calculator(self):
225223
os.path.join(self.local_scratch.path, "Efield.fld"),
226224
grid_stop=[5, 5, 5],
227225
grid_step=[0.5, 0.5, 0.5],
228-
isvector=True,
226+
is_vector=True,
229227
intrinsics="5GHz",
230228
)
231229
assert os.path.exists(os.path.join(self.local_scratch.path, "Efield.fld"))
@@ -235,10 +233,10 @@ def test_07_export_fields_from_Calculator(self):
235233
"Setup1 : LastAdaptive",
236234
self.aedtapp.available_variations.nominal_w_values_dict,
237235
os.path.join(self.local_scratch.path, "MagEfieldSph.fld"),
238-
gridtype="Spherical",
236+
grid_type="Spherical",
239237
grid_stop=[5, 300, 300],
240238
grid_step=[5, 50, 50],
241-
isvector=False,
239+
is_vector=False,
242240
intrinsics="5GHz",
243241
)
244242
assert os.path.exists(os.path.join(self.local_scratch.path, "MagEfieldSph.fld"))
@@ -248,10 +246,10 @@ def test_07_export_fields_from_Calculator(self):
248246
"Setup1 : LastAdaptive",
249247
self.aedtapp.available_variations.nominal_w_values_dict,
250248
os.path.join(self.local_scratch.path, "MagEfieldCyl.fld"),
251-
gridtype="Cylindrical",
249+
grid_type="Cylindrical",
252250
grid_stop=[5, 300, 5],
253251
grid_step=[5, 50, 5],
254-
isvector=False,
252+
is_vector=False,
255253
intrinsics="5GHz",
256254
)
257255
assert os.path.exists(os.path.join(self.local_scratch.path, "MagEfieldCyl.fld"))
@@ -271,12 +269,12 @@ def test_09_manipulate_report(self):
271269
assert self.aedtapp.post.create_report("dB(S(1,1))")
272270
assert self.aedtapp.post.create_report(
273271
expressions="MaxMagDeltaS",
274-
variations={"Pass": ["All"]},
275272
setup_sweep_name="Setup1 : AdaptivePass",
273+
variations={"Pass": ["All"]},
276274
primary_sweep_variable="Pass",
277275
report_category="Modal Solution Data",
278276
plot_type="Rectangular Plot",
279-
plotname="Solution Convergence Plot",
277+
plot_name="Solution Convergence Plot",
280278
)
281279
new_report = self.aedtapp.post.reports_by_category.modal_solution("dB(S(1,1))")
282280
assert new_report.create()
@@ -501,13 +499,13 @@ def test_14_Field_Ploton_cutplanedesignname(self):
501499
assert plot1.update_field_plot_settings()
502500
self.aedtapp.logger.info("Generating the image")
503501
plot_obj = self.aedtapp.post.plot_field_from_fieldplot(
504-
plotname=plot1.name,
502+
plot_name=plot1.name,
505503
project_path=self.local_scratch.path,
506-
meshplot=False,
507-
imageformat="jpg",
504+
mesh_plot=False,
505+
image_format="jpg",
508506
view="xy",
509-
show=False,
510507
plot_label=plot1.name + " label",
508+
show=False,
511509
)
512510
assert os.path.exists(plot_obj.image_file)
513511
os.unlink(plot_obj.image_file)
@@ -526,13 +524,13 @@ def test_14_Field_Ploton_cutplanedesignname(self):
526524
assert os.path.exists(plot_obj.image_file)
527525

528526
plot_obj = self.aedtapp.post.plot_field_from_fieldplot(
529-
plotname=plot1.name,
527+
plot_name=plot1.name,
530528
project_path=self.local_scratch.path,
531-
meshplot=False,
532-
imageformat="jpg",
529+
mesh_plot=False,
530+
image_format="jpg",
533531
view="xy",
534-
show=False,
535532
plot_label=plot1.name + " label",
533+
show=False,
536534
file_format="aedtplt",
537535
)
538536
assert os.path.exists(plot_obj.image_file)
@@ -557,11 +555,11 @@ def test_14B_Field_Ploton_Vector(self):
557555
"CutPlane",
558556
setup_name=setup_name,
559557
intrinsics=intrinsic,
560-
export_path=self.local_scratch.path,
561558
mesh_on_fields=False,
562-
imageformat="jpg",
563559
view="isometric",
564560
show=False,
561+
export_path=self.local_scratch.path,
562+
image_format="jpg",
565563
)
566564
assert os.path.exists(plot_obj.image_file)
567565

@@ -580,11 +578,11 @@ def test_15_export_plot(self):
580578
def test_16_create_field_plot(self):
581579
cutlist = ["Global:XY"]
582580
plot = self.aedtapp.post._create_fieldplot(
583-
objlist=cutlist,
584-
quantityName="Mag_E",
581+
objects=cutlist,
582+
quantity="Mag_E",
585583
setup_name=self.aedtapp.nominal_adaptive,
586584
intrinsics={},
587-
listtype="CutPlane",
585+
list_type="CutPlane",
588586
)
589587
assert plot
590588

0 commit comments

Comments
 (0)