-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added plot methods to nets. It requires matplotlib. * Added Plot methods to edb * Added example and UnitTest * Added example and UnitTest * Added example and UnitTest * Added example and UnitTest
- Loading branch information
1 parent
c538405
commit b36d772
Showing
4 changed files
with
216 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
""" | ||
Plot Nets with Matplotlib | ||
------------------------- | ||
This example shows how to use EDB Class to plot a net or a layout. | ||
""" | ||
|
||
############################################################################### | ||
# Import Section | ||
# ~~~~~~~~~~~~~~ | ||
import shutil | ||
import os | ||
import tempfile | ||
from pyaedt import generate_unique_name, examples, Edb | ||
|
||
############################################################################### | ||
# File download | ||
# ~~~~~~~~~~~~~ | ||
# In this section the aedb file will be downloaded and copied in Temporary Folder. | ||
|
||
tmpfold = tempfile.gettempdir() | ||
temp_folder = os.path.join(tmpfold, generate_unique_name("Example")) | ||
if not os.path.exists(temp_folder): | ||
os.makedirs(temp_folder) | ||
example_path = examples.download_aedb() | ||
targetfolder = os.path.join(temp_folder, "Galileo.aedb") | ||
if os.path.exists(targetfolder): | ||
shutil.rmtree(targetfolder) | ||
shutil.copytree(example_path[:-8], targetfolder) | ||
|
||
############################################################################### | ||
# Launch EDB | ||
# ~~~~~~~~~~ | ||
# This example launches the :class:`pyaedt.Edb` class. | ||
# This example uses EDB 2021.2 and uses SI units. | ||
|
||
edb = Edb(edbpath=targetfolder, edbversion="2021.2") | ||
|
||
############################################################################### | ||
# Plot a custom set of nets colored by Nets. | ||
|
||
edb.core_nets.plot(["VREF", "V3P3_S0"], color_by_layer=False) | ||
|
||
############################################################################### | ||
# Plot a custom set of nets colored by Layer. | ||
|
||
edb.core_nets.plot("V3P3_S0", color_by_layer=True) | ||
|
||
############################################################################### | ||
# Plot all nets on a layer colored by Nets. | ||
|
||
edb.core_nets.plot(None, ["TOP"], color_by_layer=False) | ||
|
||
############################################################################### | ||
# Close Db | ||
|
||
edb.close_edb() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters