Skip to content

Commit

Permalink
FEAT: new class Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ring630 committed Jun 25, 2024
1 parent 2fe732d commit 32e79cc
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# # Setup EDB for Power Integrity Analysis
# # Set up EDB for Power Integrity Analysis
# This example shows how to set up the electronics database (EDB) for power integrity analysis from a single
# configuration file.

Expand All @@ -17,17 +17,21 @@

from pyedb import Edb

temp_folder = tempfile.TemporaryDirectory(suffix=".ansys")
AEDT_VERSION = "2024.1"
NG_MODE = False

# -

# Download the example PCB data.

temp_folder = tempfile.TemporaryDirectory(suffix=".ansys")
aedb = download_file(source="edb/ANSYS-HSD_V1.aedb", destination=temp_folder.name)
download_file(source="touchstone", name="GRM32_DC0V_25degC_series.s2p", destination=temp_folder.name)

# Load example layout.

edbapp = Edb(edbversion=AEDT_VERSION)
edbapp.workflow.get_si_verse(working_directory=temp_folder.name)

# ## Create a configuration file
# In this example, we are going to use a configuration file to set up the layout for analysis.
# ### Initialize a dictionary
Expand Down Expand Up @@ -134,10 +138,6 @@

# ## Load configuration into EDB

# Load layout.

edbapp = Edb(aedb, edbversion=AEDT_VERSION)

# Load configuration file

edbapp.configuration.load(config_file=file_json)
Expand All @@ -159,7 +159,7 @@

# ### Load edb into HFSS 3D Layout.

h3d = Hfss3dLayout(aedb, version=AEDT_VERSION, non_graphical=NG_MODE, new_desktop=True)
h3d = Hfss3dLayout(edbapp.edbpath, version=AEDT_VERSION, non_graphical=NG_MODE, new_desktop=True)

# ### Analyze

Expand Down
5 changes: 5 additions & 0 deletions src/pyedb/dotnet/edb.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
from pyedb.generic.settings import settings
from pyedb.ipc2581.ipc2581 import Ipc2581
from pyedb.modeler.geometry_operators import GeometryOperators
from pyedb.workflow import Workflow

if is_linux and is_ironpython:
import subprocessdotnet as subprocess
Expand Down Expand Up @@ -4456,3 +4457,7 @@ def definitions(self):
from pyedb.dotnet.edb_core.definition.definitions import Definitions

return Definitions(self)

@property
def workflow(self):
return Workflow(self)
25 changes: 25 additions & 0 deletions src/pyedb/workflow.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import tempfile
from pathlib import Path
from pyaedt.downloads import download_file


class Workflow:
def __init__(self, pedb):
self._pedb = pedb

def get_si_verse(self, working_directory: [str, Path] = None):
"""Download SI-verse demo board.
Parameters
----------
working_directory
"""
if working_directory is None:
temp_folder = tempfile.TemporaryDirectory(suffix=".ansys")
dst = temp_folder.name
else:
dst = str(working_directory)
aedb = download_file(source="edb/ANSYS-HSD_V1.aedb", destination=dst)
self._pedb.close_edb()
self._pedb.edbpath = aedb
self._pedb.open_edb()

0 comments on commit 32e79cc

Please sign in to comment.