Skip to content

Commit

Permalink
Merge branch 'main' into release/0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcapodi78 authored and maxcapodi78 committed Oct 5, 2022
2 parents fb89fcf + 19b9674 commit a844cee
Show file tree
Hide file tree
Showing 29 changed files with 105,261 additions and 7,517 deletions.
Binary file added _unittest/example_models/T12/ami.aedtz
Binary file not shown.
2,588 changes: 2,588 additions & 0 deletions _unittest/example_models/T40/SMA_RF_Jack.a3dcomp

Large diffs are not rendered by default.

41,623 changes: 40,327 additions & 1,296 deletions _unittest/example_models/TMaxwell/Motor_EM_R2019R3.aedt

Large diffs are not rendered by default.

Binary file modified _unittest/example_models/TMaxwell/Motor_EM_R2019R3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67,269 changes: 61,405 additions & 5,864 deletions _unittest/example_models/TMaxwell/Motor_EM_R2019R3_231.aedt

Large diffs are not rendered by default.

Binary file modified _unittest/example_models/TMaxwell/Motor_EM_R2019R3_231.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
86 changes: 86 additions & 0 deletions _unittest/test_12_PostProcessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@

test_circuit_name = "Switching_Speed_FET_And_Diode"
eye_diagram = "SimpleChannel"
ami = "ami"
test_subfolder = "T12"
settings.enable_pandas_output = True

Expand All @@ -64,6 +65,7 @@ def setup_class(self):
self.q3dtest = BasisTest.add_app(self, project_name=q3d_file, application=Q3d, subfolder=test_subfolder)
self.q2dtest = Q2d(projectname=self.q3dtest.project_name)
self.eye_test = BasisTest.add_app(self, project_name=eye_diagram, application=Circuit, subfolder=test_subfolder)
self.ami_test = BasisTest.add_app(self, project_name=ami, application=Circuit, subfolder=test_subfolder)
self.array_test = BasisTest.add_app(self, project_name=array, subfolder=test_subfolder)

def teardown_class(self):
Expand Down Expand Up @@ -1111,6 +1113,90 @@ def test_72_antenna_plot(self):
)
assert os.path.exists(os.path.join(self.local_scratch.path, "contour1.jpg"))

def test_73_ami_solution_data(self):
self.ami_test.solution_type = "NexximAMI"
assert self.ami_test.post.get_solution_data(
expressions="WaveAfterProbe<b_input_43.int_ami_rx>",
setup_sweep_name="AMIAnalysis",
domain="Time",
variations=self.ami_test.available_variations.nominal,
)

assert self.ami_test.post.get_solution_data(
expressions="WaveAfterSource<b_output4_42.int_ami_tx>",
setup_sweep_name="AMIAnalysis",
domain="Time",
variations=self.ami_test.available_variations.nominal,
)

assert self.ami_test.post.get_solution_data(
expressions="InitialWave<b_output4_42.int_ami_tx>",
setup_sweep_name="AMIAnalysis",
domain="Time",
variations=self.ami_test.available_variations.nominal,
)

assert self.ami_test.post.get_solution_data(
expressions="WaveAfterChannel<b_input_43.int_ami_rx>",
setup_sweep_name="AMIAnalysis",
domain="Time",
variations=self.ami_test.available_variations.nominal,
)

assert self.ami_test.post.get_solution_data(
expressions="ClockTics<b_input_43.int_ami_rx>",
setup_sweep_name="AMIAnalysis",
domain="Clock Times",
variations=self.ami_test.available_variations.nominal,
)
probe_name = "b_input_43"
source_name = "b_output4_42"
plot_type = "WaveAfterProbe"
setup_name = "AMIAnalysis"

ignore_bits = 1000
unit_interval = 0.1e-9
assert not self.ami_test.post.sample_ami_waveform(
setup_name,
probe_name,
source_name,
self.ami_test.available_variations.nominal,
unit_interval,
ignore_bits,
plot_type,
)
if not is_ironpython:
ignore_bits = 5
unit_interval = 0.1e-9
plot_type = "InitialWave"
data1 = self.ami_test.post.sample_ami_waveform(
setup_name,
probe_name,
source_name,
self.ami_test.available_variations.nominal,
unit_interval,
ignore_bits,
plot_type,
)
assert len(data1[0]) == 45

settings.enable_pandas_output = False
ignore_bits = 5
unit_interval = 0.1e-9
clock_tics = [1e-9, 2e-9, 3e-9]
data2 = self.ami_test.post.sample_ami_waveform(
setup_name,
probe_name,
source_name,
self.ami_test.available_variations.nominal,
unit_interval,
ignore_bits,
plot_type=None,
clock_tics=clock_tics,
)
assert len(data2) == 4
assert len(data2[0]) == 3

def test_z99_delete_variations(self):
assert self.q3dtest.cleanup_solution()
vars = self.field_test.available_variations.get_variation_strings()
Expand Down
8 changes: 8 additions & 0 deletions _unittest/test_16_3d_stackup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def test_01_create_stackup(self):
self.st.dielectic_x_postion = "10mm"
gnd = self.st.add_ground_layer("gnd1")
self.st.add_dielectric_layer("diel1", thickness=1)
assert self.st.thickness.value == 1.035e-3
lay1 = self.st.add_signal_layer("lay1", thickness=0.07)
self.st.add_dielectric_layer("diel2", thickness=1.2)
top = self.st.add_signal_layer("top")
Expand Down Expand Up @@ -67,6 +68,13 @@ def test_03_padstackline(self):
assert p1.set_stop_layer("top")
p1.set_all_pad_value(1)
p1.set_all_antipad_value(3)
assert p1.padstacks_by_layer["top"].layer_name == "top"
assert p1.padstacks_by_layer["top"].pad_radius == 1
assert p1.padstacks_by_layer["top"].antipad_radius == 3
p1.padstacks_by_layer["top"].pad_radius = 2
p1.padstacks_by_layer["top"].antipad_radius = 2.5
assert p1.padstacks_by_layer["top"].pad_radius == 2
assert p1.padstacks_by_layer["top"].antipad_radius == 2.5
p1.num_sides = 8
assert p1.num_sides == 8
via = p1.add_via(50, 50)
Expand Down
8 changes: 4 additions & 4 deletions _unittest/test_27_Maxwell2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,11 @@ def test_24_assign_symmetry(self):
assert not bound.props["IsOdd"]

def test_25_export_rl_matrix(self):
self.aedtapp.set_active_design("Y_Connections")
self.aedtapp.set_active_design("Sinusoidal")
assert not self.aedtapp.export_rl_matrix("Test1", " ")
self.aedtapp.solution_type = SOLUTIONS.Maxwell2d.EddyCurrentXY
self.aedtapp.assign_matrix(sources=["Current_1", "Current_2"], matrix_name="Test1")
self.aedtapp.assign_matrix(sources=["PhaseA", "PhaseB", "PhaseC"], matrix_name="Test2")
self.aedtapp.assign_matrix(sources=["PM_I1_1_I0", "PM_I1_I0"], matrix_name="Test1")
self.aedtapp.assign_matrix(sources=["Phase_A", "Phase_B", "Phase_C"], matrix_name="Test2")
setup_name = "setupTestMatrixRL"
setup = self.aedtapp.create_setup(setupname=setup_name)
setup.props["MaximumPasses"] = 2
Expand All @@ -332,7 +332,7 @@ def test_25_export_rl_matrix(self):
assert os.path.exists(export_path_2)

def test_26_assign_current_density(self):
self.aedtapp.set_active_design("Y_Connections")
self.aedtapp.set_active_design("Sinusoidal")
assert self.aedtapp.assign_current_density("Coil", "CurrentDensity_1")
assert self.aedtapp.assign_current_density("Coil", "CurrentDensity_2", "40deg", current_density_2d="2")
assert self.aedtapp.assign_current_density(["Coil", "Coil_1"])
Expand Down
2 changes: 1 addition & 1 deletion _unittest/test_30_Q2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def test_15_export_equivalent_circuit(self):
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), file_type="test"
)
assert q2d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), model_name="q2d_q3d"
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), model_name=q2d_q3d[:-5]
)
assert not q2d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), model_name="test"
Expand Down
2 changes: 1 addition & 1 deletion _unittest/test_31_Q3D.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def test_14_export_equivalent_circuit(self):
res_limit="2ohm",
)
assert q3d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), model_name="q2d_q3d"
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), model_name=q2d_q3d[:-5]
)
assert not q3d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), model_name="test"
Expand Down
50 changes: 25 additions & 25 deletions _unittest/test_40_3dlayout_edb.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,31 +209,6 @@ def test_08_merge(self):
assert (comp.location[1] - 0.2) < tol
hfss3d.close_project(saveproject=False)

@pytest.mark.skipif(
config["NonGraphical"] and config["desktopVersion"] < "2023.1",
reason="Not running in non graphical mode. Tested only in Linux machine",
)
def test_09_3dplacement(self): # pragma: no cover
assert len(self.aedtapp.modeler.components_3d) == 2
tol = 1e-12
encrypted_model_path = os.path.join(local_path, "example_models", test_subfolder, "connector.a3dcomp")
comp = self.aedtapp.modeler.place_3d_component(
encrypted_model_path, 4, placement_layer="TOP", component_name="my_connector", pos_x=0.001, pos_y=0.002
)
if config["desktopVersion"] > "2022.2":
assert (comp.location[0] - 1) < tol
assert (comp.location[1] - 2) < tol
else:
assert (comp.location[0] - 0.001) < tol
assert (comp.location[1] - 0.002) < tol
assert comp.angle == "0deg"
assert comp.placement_layer == "TOP"
comp.placement_layer = "bottom"
assert comp.placement_layer == "BOTTOM"
comp.angle = "10deg"
assert comp.angle == "10deg"
assert comp.component_name == "my_connector"

def test_10_change_stackup(self):
assert self.aedtapp.modeler.layers.change_stackup_type("Multizone", 4)
assert len(self.aedtapp.modeler.layers.zones) == 3
Expand Down Expand Up @@ -265,3 +240,28 @@ def test_14_set_solderball(self):
assert not self.aedtapp.modeler.components["U3B2"].solderball_enabled
assert not self.aedtapp.modeler.components["L3A1"].set_solderball(None)
assert self.aedtapp.modeler.components["J1"].set_solderball("Sph")

def test_15_3dplacement(self):
self.aedtapp.insert_design("placement_3d")
l1 = self.aedtapp.modeler.layers.add_layer("BOTTOM", "signal", thickness="5mil")
self.aedtapp.modeler.layers.add_layer("diel", "dielectric", thickness="121mil", material="FR4_epoxy")
self.aedtapp.modeler.layers.add_layer("TOP", "signal", thickness="5mil", isnegative=True)
tol = 1e-12
encrypted_model_path = os.path.join(local_path, "example_models", test_subfolder, "SMA_RF_Jack.a3dcomp")
comp = self.aedtapp.modeler.place_3d_component(
encrypted_model_path, 1, placement_layer="TOP", component_name="my_connector", pos_x=0.001, pos_y=0.002
)
if config["desktopVersion"] > "2022.2":
assert (comp.location[0] - 1) < tol
assert (comp.location[1] - 2) < tol
else:
assert (comp.location[0] - 0.001) < tol
assert (comp.location[1] - 0.002) < tol
assert comp.angle == "0deg"
assert comp.placement_layer == "TOP"
comp.placement_layer = "bottom"
assert comp.placement_layer == "BOTTOM"
comp.angle = "10deg"
assert comp.angle == "10deg"
assert comp.component_name == "my_connector"
assert len(self.aedtapp.modeler.components_3d) == 1
15 changes: 7 additions & 8 deletions _unittest/test_41_3dlayout_modeler.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def test_02_stackup(self):
assert s1.top_bottom == "top"
s1.top_bottom = "neither"

assert s1.thickness == "0.035mm"
assert s1.thickness == "0.035mm" or s1.thickness == 3.5e-5
assert s1.material == "iron"
assert s1.use_etch is False
assert s1.user is False
Expand Down Expand Up @@ -155,7 +155,7 @@ def test_02_stackup(self):
layername="Diel3", layertype="dielectric", thickness="1.0mm", elevation="0.035mm", material="plexiglass"
)
assert d1.material == "plexiglass"
assert d1.thickness == "1.0mm"
assert d1.thickness == "1.0mm" or d1.thickness == 1e-3
assert d1.transparency == 60
d1.material = "fr4_epoxy"
d1.transparency = 23
Expand All @@ -173,26 +173,21 @@ def test_02_stackup(self):
assert s2.name == "Top"
assert s2.type == "signal"
assert s2.material == "copper"
assert s2.thickness == 3.5e-5
assert s2.thickness == "0.035mm" or s2.thickness == 3.5e-5
assert s2.IsNegative is True
s2.is_negative = False
assert s2.IsNegative is False

self.aedtapp.modeler.layers.refresh_all_layers()
s1 = self.aedtapp.modeler.layers.layers[self.aedtapp.modeler.layers.layer_id("Bottom")]
assert s1.thickness == "0.035mm" or s1.thickness == 3.5e-5
assert s1.material == "copper"
assert s1.fill_material == "glass"
assert s1.use_etch is True
assert s1.etch == 1.2
assert s1.user is True
assert s1.usp is True
assert s1.hfssSp["dt"] == 1
assert s1.planaremSp["ifg"] is True
d1 = self.aedtapp.modeler.layers.layers[self.aedtapp.modeler.layers.layer_id("Diel3")]
assert d1.material == "fr4_epoxy"
assert d1.thickness == "1.0mm" or d1.thickness == 1e-3
assert d1.transparency == 23
s2 = self.aedtapp.modeler.layers.layers[self.aedtapp.modeler.layers.layer_id("Top")]
assert s2.name == "Top"
assert s2.type == "signal"
Expand Down Expand Up @@ -683,3 +678,7 @@ def test_96_change_nets_visibility(self):
assert not hfss3d.modeler.change_net_visibility(["test1, test2"])
assert not hfss3d.modeler.change_net_visibility(visible="")
assert not hfss3d.modeler.change_net_visibility(visible=0)

def test_97_mesh_settings(self):
assert self.aedtapp.set_meshing_settings(mesh_method="PhiPlus", enable_intersections_check=False)
assert self.aedtapp.set_meshing_settings(mesh_method="Classic", enable_intersections_check=True)
2 changes: 1 addition & 1 deletion doc/source/API/ClientServer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ You can start AEDT from Python in the graphical or non-graphical mode.

.. code:: python
Launch AEDT 2022 R1 in non-graphical mode
# Launch AEDT 2022 R1 in non-graphical mode
from pyaedt import Desktop, Maxwell3d
with Desktop(specified_version="2022.1", non_graphical=True, new_desktop_session=True, close_on_exit=True,
Expand Down
Loading

0 comments on commit a844cee

Please sign in to comment.