From cf3bf17fea95d28e4a18f1babb12057bd75de1ee Mon Sep 17 00:00:00 2001 From: Samuel Lopez <85613111+Samuelopez-ansys@users.noreply.github.com> Date: Sat, 20 Apr 2024 13:56:32 +0200 Subject: [PATCH] REFACT: fIX issue in examples (#4558) --- examples/01-HFSS3DLayout/Hfss3DComponent.py | 9 +++++++-- examples/07-TwinBuilder/02-Wiring_A_Rectifier.py | 3 +-- pyaedt/modeler/circuits/PrimitivesNexxim.py | 7 +++---- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/examples/01-HFSS3DLayout/Hfss3DComponent.py b/examples/01-HFSS3DLayout/Hfss3DComponent.py index 5bdace325e2..daeb0177ae3 100644 --- a/examples/01-HFSS3DLayout/Hfss3DComponent.py +++ b/examples/01-HFSS3DLayout/Hfss3DComponent.py @@ -199,8 +199,8 @@ h3d["len"] = str(trace_length) + "mm" h3d["w1"] = str(trace_width) + "mm" -h3d.create_edge_port(line, h3d.modeler[line].top_edge_x, is_wave_port=True, wave_horizontal_extension=15) line = h3d.modeler.create_line("L1", [[0, 0], ["len", 0]], lw="w1", name="microstrip", net="microstrip") +h3d.create_edge_port(line, h3d.modeler[line.name].top_edge_x, is_wave_port=True, wave_horizontal_extension=15) ############################################################################### # Create void on Ground plane for pin @@ -218,7 +218,12 @@ h3d.edit_hfss_extents(diel_extent_horizontal_padding="0.2", air_vertical_positive_padding="0", air_vertical_negative_padding="2", airbox_values_as_dim=False) setup1 = h3d.create_setup() -sweep1 = h3d.create_linear_count_sweep(setup1.name, "GHz", 0.01, 8, 1601, sweep_type="Interpolating") +sweep1 = h3d.create_linear_count_sweep(setup1.name, + "GHz", + 0.01, + 8, + 1601, + sweep_type="Interpolating") setup1.props["AdaptiveSettings"]["SingleFrequencyDataList"]["AdaptiveFrequencyData"]["AdaptiveFrequency"] = freq setup1.props["AdaptiveSettings"]["SingleFrequencyDataList"]["AdaptiveFrequencyData"]["MaxPasses"] = max_steps diff --git a/examples/07-TwinBuilder/02-Wiring_A_Rectifier.py b/examples/07-TwinBuilder/02-Wiring_A_Rectifier.py index 9b7de137a56..c9192f669e2 100644 --- a/examples/07-TwinBuilder/02-Wiring_A_Rectifier.py +++ b/examples/07-TwinBuilder/02-Wiring_A_Rectifier.py @@ -124,7 +124,6 @@ tb.analyze_setup("TR") - ############################################################################### # Get report data and plot using Matplotlib # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -136,7 +135,7 @@ x = tb.post.get_solution_data(E_Value, "TR", "Time") plt.plot(x.intrinsics["Time"], x.data_real(E_Value)) -R_Value = "RL.V" +R_Value = "R1.V" x = tb.post.get_solution_data(R_Value, "TR", "Time") plt.plot(x.intrinsics["Time"], x.data_real(R_Value)) diff --git a/pyaedt/modeler/circuits/PrimitivesNexxim.py b/pyaedt/modeler/circuits/PrimitivesNexxim.py index ea080cff015..bc43400b011 100644 --- a/pyaedt/modeler/circuits/PrimitivesNexxim.py +++ b/pyaedt/modeler/circuits/PrimitivesNexxim.py @@ -681,12 +681,12 @@ def create_inductor(self, name=None, value=50, location=None, angle=0, use_insta return cmpid @pyaedt_function_handler(compname="name") - def create_capacitor(self, cname=None, value=50, location=None, angle=0, use_instance_id_netlist=False): + def create_capacitor(self, name=None, value=50, location=None, angle=0, use_instance_id_netlist=False): """Create a capacitor. Parameters ---------- - cname : str, optional + name : str, optional Name of the capacitor. The default is ``None``. value : float, optional Capacitor value. The default is ``50``. @@ -708,12 +708,11 @@ def create_capacitor(self, cname=None, value=50, location=None, angle=0, use_ins >>> oEditor.CreateComponent """ - if location == None: location = [] cmpid = self.create_component( - cname, + name, component_library="Capacitors", component_name="CAP_", location=location,