From 3233439ee6075c5e30e2029b6f9744a9e8c12506 Mon Sep 17 00:00:00 2001 From: SMoraisAnsys <146729917+SMoraisAnsys@users.noreply.github.com> Date: Thu, 1 Feb 2024 06:57:17 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Kathy Pippert <84872299+PipKat@users.noreply.github.com> --- .../03_5G_antenna_example_parametrics.py | 36 +++++++++---------- examples/00-EDB/04_edb_parametrized_design.py | 14 ++++---- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/examples/00-EDB/03_5G_antenna_example_parametrics.py b/examples/00-EDB/03_5G_antenna_example_parametrics.py index b6e838e8b8f..692f7539c6d 100644 --- a/examples/00-EDB/03_5G_antenna_example_parametrics.py +++ b/examples/00-EDB/03_5G_antenna_example_parametrics.py @@ -16,10 +16,10 @@ non_graphical = False -# ## Creating data classes +# ## Create data classes # # Data classes are useful to do calculations and store variables. -# We create 3 Data classes for Patch, Line and Array +# There are three data classes: ``Patch``, ``Line``, and ``Array``. # + class Patch: @@ -138,7 +138,7 @@ def points(self): edb.modeler.create_polygon(linear_array.points, "GND", net_name="GND") -# Add connector pin that will be used to assign the port. +# Add the connector pin to use to assign the port. edb.padstacks.create(padstackname="Connector_pin", holediam="100um", paddiam="0", antipaddiam="200um") con_pin = edb.padstacks.place( @@ -199,7 +199,7 @@ def points(self): edb.close_edb() print("EDB saved correctly to {}. You can import in AEDT.".format(aedb_path)) -# ## 3D Component in HFSS +# ## 3D component in HFSS # # First create an instance of the ``pyaedt.Hfss`` class. If you set # > ``non_graphical = False @@ -216,20 +216,20 @@ def points(self): close_on_exit=True, solution_type="Terminal") -# Set units to mm. +# Set units to ``mm``. h3d.modeler.model_units = "mm" -# ## Import the EDB as a 3D Component +# ## Import the EDB as a 3D component # # One or more layout components can be imported into HFSS. The combination of layout data and 3D CAD data helps streamline # model creation and setup. component = h3d.modeler.insert_layout_component(aedb_path, parameter_mapping=True) -# ## Expose the Component Paramers +# ## Expose the component parameters # -# If a layout component is parametric, parameters can be exposed and changed in HFSS +# If a layout component is parametric, you can expose and change parameters in HFSS # + component.parameters @@ -254,9 +254,9 @@ def points(self): h3d.assign_radiation_boundary_to_objects("Region") # - -# ### Analysis Setup +# ### Set up analysis # -# The finite element mesh is adapted iteratively. The maximum number of adaptive passes is set using the ``MaximumPasses`` property. This model will converge such that the $S_{11}$ will be independent of the mesh. The default accuracy setting is: +# The finite element mesh is adapted iteratively. The maximum number of adaptive passes is set using the ``MaximumPasses`` property. This model converges such that the $S_{11}$ is independent of the mesh. The default accuracy setting is: # $$ \max(|\Delta S|) < 0.02 $$ setup = h3d.create_setup() @@ -282,9 +282,9 @@ def points(self): solution = h3d.post.get_solution_data(trace[0]) solution.plot() -# ## Plot Far Fields in AEDT +# ## Plot far fields in AEDT # -# Plot Radiation patterns in AEDT. +# Plot radiation patterns in AEDT. # + variations = {} @@ -299,24 +299,24 @@ def points(self): new_report.create("Realized2D") # - -# ## Plot Far Fields in AEDT +# ## Plot far fields in AEDT # -# Plot Radiation patterns in AEDT. +# Plot radiation patterns in AEDT new_report.report_type = "3D Polar Plot" new_report.secondary_sweep = "Phi" new_report.create("Realized3D") -# ## Plot Far Fields outside AEDT +# ## Plot far fields outside AEDT # -# Plot Radiation patterns outside AEDT. +# Plot radiation patterns outside AEDT solutions_custom = new_report.get_solution_data() solutions_custom.plot_3d() # ## Plot E Field on nets and layers # -# Plot E Field on nets and layers in AEDT. +# Plot E Field on nets and layers in AEDT h3d.post.create_fieldplot_layers_nets( [["TOP","Array_antenna"]], @@ -334,7 +334,7 @@ def points(self): h3d.save_project(os.path.join(temp_dir, "test_layout.aedt")) h3d.release_desktop() -# ### Temp Directory Cleanup +# ### Clean up the temporary directory # # The following command removes the project and the temporary directory. If you'd like to save this project, save it to a folder of your choice prior to running the following cell. diff --git a/examples/00-EDB/04_edb_parametrized_design.py b/examples/00-EDB/04_edb_parametrized_design.py index b806f2efb06..29394147992 100644 --- a/examples/00-EDB/04_edb_parametrized_design.py +++ b/examples/00-EDB/04_edb_parametrized_design.py @@ -15,8 +15,8 @@ # ## Set non-graphical mode # -# Set non-graphical mode. The default is ``False`` in order to open -# the AEDT user interface. +# Set non-graphical mode. The default is ``False``, which opens +# the AEDT UI. non_graphical = False @@ -57,8 +57,8 @@ {"name": "diel_1", "layer_type": "dielectric", "thickness": "275um", "material": "FR4_epoxy"}, {"name": "top", "layer_type": "signal", "thickness": "35um", "material": "copper"}] -# Create EDB stackup. -# Bottom layer +# Create the EDB stackup. +# Define the bottom layer prev = None for layer in layers: @@ -247,7 +247,7 @@ edb.save_edb() edb.close_edb() -# Open the project in AEDT 3D Layout. +# Open the project in HFSS 3D Layout. h3d = pyaedt.Hfss3dLayout(projectname=aedb_path, specified_version="2023.2", non_graphical=non_graphical, new_desktop_session=True) @@ -275,7 +275,7 @@ ) # - -# Define the differential pairs to be used to calculte differential and common mode +# Define the differential pairs to used to calculate differential and common mode # s-parameters. h3d.set_differential_pair(diff_name="In", positive_terminal="wave_port_1:T1", negative_terminal="wave_port_1:T2") @@ -285,7 +285,7 @@ h3d.analyze() -# Plot the results and shut down the Electronics Desktop. +# Plot the results and shut down AEDT. solutions = h3d.post.get_solution_data(["dB(S(In,In))", "dB(S(In,Out))"], context="Differential Pairs") solutions.plot()