From 1e0f3aad7fd0bc39e413d8497757a8da1b9e154e Mon Sep 17 00:00:00 2001 From: SMoraisAnsys <146729917+SMoraisAnsys@users.noreply.github.com> Date: Thu, 1 Feb 2024 06:49:56 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Kathy Pippert <84872299+PipKat@users.noreply.github.com> --- examples/00-EDB/00_EDB_Create_VIA.py | 8 +++---- examples/00-EDB/01_edb_example.py | 36 ++++++++++++++-------------- examples/00-EDB/02_edb_to_ipc2581.py | 6 ++--- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/examples/00-EDB/00_EDB_Create_VIA.py b/examples/00-EDB/00_EDB_Create_VIA.py index 5cc4f610e6f..71421ff955b 100644 --- a/examples/00-EDB/00_EDB_Create_VIA.py +++ b/examples/00-EDB/00_EDB_Create_VIA.py @@ -22,7 +22,7 @@ # ## Add stackup layers # Add stackup layers. -# A stackup can be created layer by layer or imported from a csv file or xml file. +# A stackup can be created layer by layer or imported from a CSV file or XML file. edb.stackup.add_layer("GND") edb.stackup.add_layer("Diel", "GND", layer_type="dielectric", thickness="0.1mm", material="FR4_epoxy") @@ -53,11 +53,11 @@ edb.padstacks.place([45e-3, -5e-3], "MyVia") -# ## Geometry Plot +# ## Generate geometry plot edb.nets.plot(None, color_by_net=True) -# ## Stackup Plot +# ## Generate stackup plot edb.stackup.plot(plot_definitions="MyVia") @@ -69,7 +69,7 @@ edb.close_edb() print("EDB saved correctly to {}. You can import in AEDT.".format(aedb_path)) -# ### Temp Directory Cleanup +# ### Clean up 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/01_edb_example.py b/examples/00-EDB/01_edb_example.py index bf19005453e..0df5a65c8ea 100644 --- a/examples/00-EDB/01_edb_example.py +++ b/examples/00-EDB/01_edb_example.py @@ -19,7 +19,7 @@ aedt_file = targetfile[:-4] + "aedt" # - -# ## Electronics Database (EDB) +# ## Launch Ansys Electronics Database (EDB) # # Instantiate an instance of the `pyaedt.Edb` class # using EDB 2023 R2 and SI units. @@ -31,7 +31,7 @@ # ## Identify nets and components # -# The ``Edb.nets.netlist`` and ``Edb.components.components`` propreties contain information +# The ``Edb.nets.netlist`` and ``Edb.components.components`` properties contain information # about all of the nets and components. The following cell uses this information to print the number of nets and # components. @@ -40,9 +40,9 @@ print("Components {}".format(len(edb.components.components.keys()))) print("elapsed time = ", time.time() - start) -# ## Identify Pin Positions +# ## Identify pin positions # -# The next section shows how to obtain all pins for a specific component and +# This code shows how to obtain all pins for a specific component and # print the ``[x, y]`` position of each pin. pins = edb.components["U2"].pins @@ -57,10 +57,10 @@ count += 1 # Get all nets connected to a specific component. Print -# the pin and the name of the net to which it is connected. +# the pin and the name of the net that it is connected to. connections = edb.components.get_component_net_connection_info("U2") -n_print = 0 # Counter to limite the number of printed lines. +n_print = 0 # Counter to limit the number of printed lines. print_max = 15 for m in range(len(connections["pin_name"])): ref_des = connections["refdes"][m] @@ -77,13 +77,13 @@ rats = edb.components.get_rats() -# ## Idenify Connected Nets +# ## Identify connected nets # -# The method ``get_dcconnected_net_list()`` retrieves a list of +# The ``get_dcconnected_net_list()`` method retrieves a list of # all DC-connected power nets. Each group of connected nets is returned -# as a [set](https://docs.python.org/3/tutorial/datastructures.html#sets) -# The first argument to the method is the list of ground nets which will -# not be considered in the search for connected nets. +# as a [set](https://docs.python.org/3/tutorial/datastructures.html#sets). +# The first argument to the method is the list of ground nets, which are +# not considered in the search for connected nets. GROUND_NETS = ["GND", "GND_DP"] dc_connected_net_list = edb.nets.get_dcconnected_net_list(GROUND_NETS) @@ -121,16 +121,16 @@ print(s) # - -# ## Remove Unused Components +# ## Remove unused components # # Delete all RLC components that are connected with only one pin. -# The method ``Edb.components.delete_single_pin_rlc()`` +# The ``Edb.components.delete_single_pin_rlc()`` method # provides a useful way to # remove components that are not needed for the simulation. edb.components.delete_single_pin_rlc() -# Unused components can also be removed explicitly by name. +# You can also remove unused components explicitly by name. edb.components.delete("C380") @@ -139,14 +139,14 @@ edb.nets.delete("PDEN") # Print the top and bottom elevation of the stackup obtained using -# the method ``Edb.stackup.limits()``. +# the ``Edb.stackup.limits()`` method. s = "Top layer name: \"{top}\", Elevation: {top_el:.2f} " s += "mm\nBottom layer name: \"{bot}\", Elevation: {bot_el:2f} mm" top, top_el, bot, bot_el = edb.stackup.limits() print(s.format(top = top, top_el = top_el*1E3, bot = bot, bot_el = bot_el*1E3)) -# ## Setup for SIwave DCIR analysis +# ## Set up for SIwave DCIR analysis # # Create a voltage source and then set up a DCIR analysis. @@ -166,14 +166,14 @@ siw_file = edb.solve_siwave() -# ## Export Results +# ## Export results # # Export all quantities calculated from the DC-IR analysis. The following method runs SIwave in batch mode from # the command line. Results are written to the edb folder. outputs = edb.export_siwave_dc_results(siw_file, setup.name, ) -# Close the EDB. After EDB is closed, it can be opened by AEDT. +# Close EDB. After EDB is closed, it can be opened by AEDT. edb.close_edb() diff --git a/examples/00-EDB/02_edb_to_ipc2581.py b/examples/00-EDB/02_edb_to_ipc2581.py index c1864bf900f..230dd25815e 100644 --- a/examples/00-EDB/02_edb_to_ipc2581.py +++ b/examples/00-EDB/02_edb_to_ipc2581.py @@ -18,8 +18,8 @@ # ## Launch EDB # -# Launch the `pyaedt.Edb` class, using Verson 2023. -# > Note that length dimensions passed to Edb are in SI units. +# Launch the `pyaedt.Edb` class, using EDB 2023. +# > Note that length dimensions passed to EDB are in SI units. edb = pyaedt.Edb(edbpath=targetfile, edbversion="2023.2") @@ -46,7 +46,7 @@ ) edb.nets.plot(None, None, color_by_net=True) -# Export the EDB to IPC2581 file. +# Export the EDB to an IPC2581 file. edb.export_to_ipc2581(ipc2581_file_name, "inch") print("IPC2581 File has been saved to {}".format(ipc2581_file_name))