Skip to content

Commit

Permalink
REFACT: fIX issue in examples (#4558)
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuelopez-ansys authored Apr 20, 2024
1 parent 25ce6a5 commit cf3bf17
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
9 changes: 7 additions & 2 deletions examples/01-HFSS3DLayout/Hfss3DComponent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
3 changes: 1 addition & 2 deletions examples/07-TwinBuilder/02-Wiring_A_Rectifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@

tb.analyze_setup("TR")


###############################################################################
# Get report data and plot using Matplotlib
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -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))

Expand Down
7 changes: 3 additions & 4 deletions pyaedt/modeler/circuits/PrimitivesNexxim.py
Original file line number Diff line number Diff line change
Expand Up @@ -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``.
Expand All @@ -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,
Expand Down

0 comments on commit cf3bf17

Please sign in to comment.