Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Kathy Pippert <[email protected]>
  • Loading branch information
SMoraisAnsys and PipKat authored Feb 1, 2024
1 parent 69d45ca commit 1e0f3aa
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
8 changes: 4 additions & 4 deletions examples/00-EDB/00_EDB_Create_VIA.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")

Expand All @@ -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.

Expand Down
36 changes: 18 additions & 18 deletions examples/00-EDB/01_edb_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.

Expand All @@ -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
Expand All @@ -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]
Expand All @@ -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)
Expand Down Expand Up @@ -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")

Expand All @@ -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.

Expand All @@ -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()

Expand Down
6 changes: 3 additions & 3 deletions examples/00-EDB/02_edb_to_ipc2581.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -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))
Expand Down

0 comments on commit 1e0f3aa

Please sign in to comment.