diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 117a1bba8..4d0eec84a 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -14,6 +14,7 @@ on: env: MAIN_PYTHON_VERSION: '3.10' PACKAGE_NAME: 'pyaedt-examples' + ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -78,14 +79,15 @@ jobs: doc-build: name: Build documentation - runs-on: [pyaedt, Windows] + runs-on: [self-hosted, Windows, pyaedt-examples] steps: - uses: actions/checkout@v4 - name: Set up Python ${{ env.MAIN_PYTHON_VERSION }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v4 with: python-version: ${{ env.MAIN_PYTHON_VERSION }} + use-cache: false - name: Create virtual environment run: | @@ -113,8 +115,9 @@ jobs: # Use environment variable to keep the doctree and avoid redundant build for PDF pages - name: Create HTML documentation + env: + SPHINXBUILD_KEEP_DOCTREEDIR: "1" run: | - echo "SPHINXBUILD_KEEP_DOCTREEDIR=1" >> $GITHUB_ENV .venv\Scripts\Activate.ps1 . .\doc\make.bat html @@ -128,8 +131,9 @@ jobs: # Use environment variable to remove the doctree after the build of PDF pages # Keeping doctree could cause an issue, see https://github.com/ansys/pyaedt/pull/3844/files - name: Create PDF documentation + env: + SPHINXBUILD_KEEP_DOCTREEDIR: "0" run: | - echo "SPHINXBUILD_KEEP_DOCTREEDIR=0" >> $GITHUB_ENV .venv\Scripts\Activate.ps1 . .\doc\make.bat pdf diff --git a/doc/source/_static/css/custom.css b/doc/source/_static/css/custom.css index 5367732a0..abe767da6 100644 --- a/doc/source/_static/css/custom.css +++ b/doc/source/_static/css/custom.css @@ -31,3 +31,11 @@ nav.bd-links ul li.toctree-l4 > a { font-size: .8rem; text-indent: 3px; } + +div.cell_output { + text-align: left !important; +} + +div.nbinput.container div.input_area, div.nboutput.container div.output_area { + display: block; +} diff --git a/doc/source/conf.py b/doc/source/conf.py index 61c00f25c..e8c8c0c01 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -77,7 +77,7 @@ def remove_doctree(app, exception): # Keep the doctree to avoid creating it twice. This is typically helpful in CI/CD # where we want to build both HTML and PDF pages. - if bool(os.getenv("SPHINXBUILD_KEEP_DOCTREEDIR", False)): + if bool(int(os.getenv("SPHINXBUILD_KEEP_DOCTREEDIR", "0"))): logger.info(f"Keeping directory {app.doctreedir}.") else: size = directory_size(app.doctreedir) @@ -204,7 +204,13 @@ def check_example_error(app, pagename, templatename, context, doctree): if any( map( lambda msg: msg in context["body"], - ["UsageError", "NameError", "DeadKernelError", "NotebookError"], + [ + "UsageError", + "NameError", + "DeadKernelError", + "NotebookError", + "CellExecutionError", + ], ) ): logger.error(f"An error was detected in file {pagename}") diff --git a/examples/00-EDB/00_EDB_Create_VIA.py b/examples/EDB/00_EDB_Create_VIA.py similarity index 94% rename from examples/00-EDB/00_EDB_Create_VIA.py rename to examples/EDB/00_EDB_Create_VIA.py index 04150e601..d083caecb 100644 --- a/examples/00-EDB/00_EDB_Create_VIA.py +++ b/examples/EDB/00_EDB_Create_VIA.py @@ -13,17 +13,17 @@ import tempfile from ansys.pyaedt.examples.constants import EDB_VERSION -import pyaedt +import pyedb temp_dir = tempfile.TemporaryDirectory(suffix=".ansys") aedb_path = os.path.join(temp_dir.name, "create_via.aedb") print(f"AEDB file path: {aedb_path}") -# Select EDB version (change it manually if needed, e.g. "2023.2") +# Select EDB version (change it manually if needed, e.g. "2024.1") edb_version = EDB_VERSION print(f"EDB version: {edb_version}") -edb = pyaedt.Edb(edbpath=aedb_path, edbversion=edb_version) +edb = pyedb.Edb(edbpath=aedb_path, edbversion=edb_version) # - # ## Add stackup layers diff --git a/examples/00-EDB/01_edb_example.py b/examples/EDB/01_edb_example.py similarity index 93% rename from examples/00-EDB/01_edb_example.py rename to examples/EDB/01_edb_example.py index 9384fd3c2..337f04d28 100644 --- a/examples/00-EDB/01_edb_example.py +++ b/examples/EDB/01_edb_example.py @@ -10,10 +10,11 @@ import time from ansys.pyaedt.examples.constants import EDB_VERSION -import pyaedt +import pyedb +from pyedb.misc.downloads import download_file temp_dir = tempfile.TemporaryDirectory(suffix=".ansys") -targetfile = pyaedt.downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_dir.name) +targetfile = download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_dir.name) siwave_file = os.path.join(os.path.dirname(targetfile), "ANSYS-HSD_V1.siw") print(targetfile) @@ -22,17 +23,17 @@ # ## Launch Ansys Electronics Database (EDB) # -# Instantiate an instance of the `pyaedt.Edb` class using SI units. +# Instantiate an instance of the `pyedb.Edb` class using SI units. # + if os.path.exists(aedt_file): os.remove(aedt_file) -# Select EDB version (change it manually if needed, e.g. "2023.2") +# Select EDB version (change it manually if needed, e.g. "2024.1") edb_version = EDB_VERSION print(f"EDB version: {edb_version}") -edb = pyaedt.Edb(edbpath=targetfile, edbversion=edb_version) +edb = pyedb.Edb(edbpath=targetfile, edbversion=edb_version) # - # ## Identify nets and components @@ -193,7 +194,7 @@ # using the SIwave user interface. This command works on Window OS only. # + -# siwave = pyaedt.Siwave("2023.2") +# siwave = pyedb.Siwave("2024.1") # siwave.open_project(siwave_file) # report_file = os.path.join(temp_folder,'Ansys.htm') diff --git a/examples/00-EDB/02_edb_to_ipc2581.py b/examples/EDB/02_edb_to_ipc2581.py similarity index 75% rename from examples/00-EDB/02_edb_to_ipc2581.py rename to examples/EDB/02_edb_to_ipc2581.py index 0dace03b1..b49ca48da 100644 --- a/examples/00-EDB/02_edb_to_ipc2581.py +++ b/examples/EDB/02_edb_to_ipc2581.py @@ -9,34 +9,36 @@ import tempfile from ansys.pyaedt.examples.constants import EDB_VERSION -import pyaedt +import pyedb +from pyedb.generic.general_methods import generate_unique_name +from pyedb.misc.downloads import download_file # - # ## Download the AEDB file and copy it in the temporary folder. temp_dir = tempfile.TemporaryDirectory(suffix=".ansys") -targetfile = pyaedt.downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_dir.name) +targetfile = download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_dir.name) ipc2581_file_name = os.path.join(temp_dir.name, "Ansys_Hsd.xml") print(targetfile) # ## Launch EDB # -# Launch the `pyaedt.Edb` class, using EDB 2023. +# Launch the `pyedb.Edb` class, using EDB 2023. # > Note that length dimensions passed to EDB are in SI units. # + -# Select EDB version (change it manually if needed, e.g. "2023.2") +# Select EDB version (change it manually if needed, e.g. "2024.1") edb_version = EDB_VERSION print(f"EDB version: {edb_version}") -edb = pyaedt.Edb(edbpath=targetfile, edbversion=edb_version) +edb = pyedb.Edb(edbpath=targetfile, edbversion=edb_version) # - # ## Parametrize the width of a trace. edb.modeler.parametrize_trace_width( - "A0_N", parameter_name=pyaedt.generate_unique_name("Par"), variable_value="0.4321mm" + "A0_N", parameter_name=generate_unique_name("Par"), variable_value="0.4321mm" ) # ## Create a cutout and plot it. diff --git a/examples/00-EDB/03_5G_antenna_example_parametrics.py b/examples/EDB/03_5G_antenna_example_parametrics.py similarity index 97% rename from examples/00-EDB/03_5G_antenna_example_parametrics.py rename to examples/EDB/03_5G_antenna_example_parametrics.py index 16e97e25b..4185944b2 100644 --- a/examples/00-EDB/03_5G_antenna_example_parametrics.py +++ b/examples/EDB/03_5G_antenna_example_parametrics.py @@ -14,6 +14,7 @@ from ansys.pyaedt.examples.constants import EDB_VERSION import pyaedt +import pyedb # - @@ -79,18 +80,18 @@ def points(self): # ## Launch EDB # -# PyAEDT.Edb allows to open existing Edb project or create a new empty project. +# PyEDB.Edb allows to open existing Edb project or create a new empty project. # + temp_dir = tempfile.TemporaryDirectory(suffix=".ansys") aedb_path = os.path.join(temp_dir.name, "linear_array.aedb") -# Select EDB version (change it manually if needed, e.g. "2023.2") +# Select EDB version (change it manually if needed, e.g. "2024.1") edb_version = EDB_VERSION print(f"EDB version: {edb_version}") # Create an instance of the Edb class. -edb = pyaedt.Edb(edbpath=aedb_path, edbversion=edb_version) +edb = pyedb.Edb(edbpath=aedb_path, edbversion=edb_version) # - # Add stackup layers @@ -244,7 +245,7 @@ def points(self): h3d = pyaedt.Hfss( projectname="Demo_3DComp", designname="Linear_Array", - specified_version="2023.2", + specified_version="2024.1", new_desktop_session=True, non_graphical=non_graphical, close_on_exit=True, diff --git a/examples/00-EDB/04_edb_parametrized_design.py b/examples/EDB/04_edb_parametrized_design.py similarity index 98% rename from examples/00-EDB/04_edb_parametrized_design.py rename to examples/EDB/04_edb_parametrized_design.py index d0edeca28..f680e1cde 100644 --- a/examples/00-EDB/04_edb_parametrized_design.py +++ b/examples/EDB/04_edb_parametrized_design.py @@ -16,6 +16,7 @@ from ansys.pyaedt.examples.constants import EDB_VERSION import pyaedt +import pyedb # - @@ -32,11 +33,11 @@ temp_dir = tempfile.TemporaryDirectory(suffix=".ansys") aedb_path = os.path.join(temp_dir.name, "pcb.aedb") -# Select EDB version (change it manually if needed, e.g. "2023.2") +# Select EDB version (change it manually if needed, e.g. "2024.1") edb_version = EDB_VERSION print(f"EDB version: {edb_version}") -edb = pyaedt.Edb(edbpath=aedb_path, edbversion=edb_version) +edb = pyedb.Edb(edbpath=aedb_path, edbversion=edb_version) # - # Define the parameters. @@ -303,7 +304,7 @@ h3d = pyaedt.Hfss3dLayout( projectname=aedb_path, - specified_version="2023.2", + specified_version="2024.1", non_graphical=non_graphical, new_desktop_session=True, ) diff --git a/examples/00-EDB/05_Plot_nets.py b/examples/EDB/05_Plot_nets.py similarity index 82% rename from examples/00-EDB/05_Plot_nets.py rename to examples/EDB/05_Plot_nets.py index fac60c7da..9d5d96aa2 100644 --- a/examples/00-EDB/05_Plot_nets.py +++ b/examples/EDB/05_Plot_nets.py @@ -13,29 +13,30 @@ import tempfile from ansys.pyaedt.examples.constants import EDB_VERSION -import pyaedt +import pyedb +from pyedb.misc.downloads import download_file # - # ## Download the EDB and copy it into the temporary folder. temp_dir = tempfile.TemporaryDirectory(suffix=".ansys") -targetfolder = pyaedt.downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_dir.name) +targetfolder = download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_dir.name) -# ## Create an instance of the Electronics Database using the `pyaedt.Edb` class. +# ## Create an instance of the Electronics Database using the `pyedb.Edb` class. # # > Note that units are SI. # + -# Select EDB version (change it manually if needed, e.g. "2023.2") +# Select EDB version (change it manually if needed, e.g. "2024.1") edb_version = EDB_VERSION print(f"EDB version: {edb_version}") -edb = pyaedt.Edb(edbpath=targetfolder, edbversion=edb_version) +edb = pyedb.Edb(edbpath=targetfolder, edbversion=edb_version) # - # Display the nets on a layer. You can display the net geometry directly in Python using -# ``matplotlib`` from the ``pyaedt.Edb`` class. +# ``matplotlib`` from the ``pyedb.Edb`` class. edb.nets.plot("AVCC_1V3") diff --git a/examples/00-EDB/06_Advanced_EDB.py b/examples/EDB/06_Advanced_EDB.py similarity index 95% rename from examples/00-EDB/06_Advanced_EDB.py rename to examples/EDB/06_Advanced_EDB.py index 982b7c367..514563cf5 100644 --- a/examples/00-EDB/06_Advanced_EDB.py +++ b/examples/EDB/06_Advanced_EDB.py @@ -10,7 +10,7 @@ from ansys.pyaedt.examples.constants import EDB_VERSION import numpy as np -import pyaedt +import pyedb # Create the EDB project. @@ -34,14 +34,14 @@ def create_ground_planes(edb, layers): # ## Create the EDB # # Create the EDB instance. -# If the path doesn't exist, PyAEDT automatically generates a new AEDB folder. +# If the path doesn't exist, PyEDB automatically generates a new AEDB folder. # + -# Select EDB version (change it manually if needed, e.g. "2023.2") +# Select EDB version (change it manually if needed, e.g. "2024.1") edb_version = EDB_VERSION print(f"EDB version: {edb_version}") -edb = pyaedt.Edb(edbpath=aedb_path, edbversion=edb_version) +edb = pyedb.Edb(edbpath=aedb_path, edbversion=edb_version) # - # Insert the stackup layers. diff --git a/examples/00-EDB/08_CPWG.py b/examples/EDB/08_CPWG.py similarity index 92% rename from examples/00-EDB/08_CPWG.py rename to examples/EDB/08_CPWG.py index 7481b6eba..55905ea7a 100644 --- a/examples/00-EDB/08_CPWG.py +++ b/examples/EDB/08_CPWG.py @@ -14,6 +14,8 @@ from ansys.pyaedt.examples.constants import AEDT_VERSION, EDB_VERSION import numpy as np import pyaedt +import pyedb +from pyedb.generic.general_methods import generate_unique_folder_name, generate_unique_name # ## Set non-graphical mode @@ -24,16 +26,14 @@ # ## Launch EDB # + -aedb_path = os.path.join( - pyaedt.generate_unique_folder_name(), pyaedt.generate_unique_name("pcb") + ".aedb" -) +aedb_path = os.path.join(generate_unique_folder_name(), generate_unique_name("pcb") + ".aedb") print(aedb_path) -# Select EDB version (change it manually if needed, e.g. "2023.2") +# Select EDB version (change it manually if needed, e.g. "2024.1") edb_version = EDB_VERSION print(f"EDB version: {edb_version}") -edbapp = pyaedt.Edb(edbpath=aedb_path, edbversion=edb_version) +edbapp = pyedb.Edb(edbpath=aedb_path, edbversion=edb_version) # - # ## Define parameters diff --git a/examples/00-EDB/09_Configuration.py b/examples/EDB/09_Configuration.py similarity index 94% rename from examples/00-EDB/09_Configuration.py rename to examples/EDB/09_Configuration.py index 286ebff0e..2fe7a19c0 100644 --- a/examples/00-EDB/09_Configuration.py +++ b/examples/EDB/09_Configuration.py @@ -16,25 +16,27 @@ from ansys.pyaedt.examples.constants import EDB_VERSION import pyaedt +import pyedb +from pyedb.misc.downloads import download_file # - # Download the AEDB file and copy it to a temporary folder. temp_dir = tempfile.TemporaryDirectory(suffix=".ansys") -target_aedb = pyaedt.downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_dir.name) +target_aedb = download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_dir.name) print("Project folder is", target_aedb) # ## Launch EDB # -# Launch the ``pyaedt.Edb`` class using EDB 2023 R2. Length units are SI. +# Launch the ``pyedb.Edb`` class using EDB 2023 R2. Length units are SI. # + -# Select EDB version (change it manually if needed, e.g. "2023.2") +# Select EDB version (change it manually if needed, e.g. "2024.1") edb_version = EDB_VERSION print(f"EDB version: {edb_version}") -edbapp = pyaedt.Edb(target_aedb, edbversion=edb_version) +edbapp = pyedb.Edb(target_aedb, edbversion=edb_version) # - # ## Import definitions @@ -188,7 +190,7 @@ # Set ``non_graphical=True`` to run the simulation in non-graphical mode. h3d = pyaedt.Hfss3dLayout( - specified_version="2023.2", + specified_version="2024.1", projectname=target_aedb, non_graphical=False, new_desktop_session=False, diff --git a/examples/00-EDB/10_GDS_workflow.py b/examples/EDB/10_GDS_workflow.py similarity index 91% rename from examples/00-EDB/10_GDS_workflow.py rename to examples/EDB/10_GDS_workflow.py index 894286a54..66809f08a 100644 --- a/examples/00-EDB/10_GDS_workflow.py +++ b/examples/EDB/10_GDS_workflow.py @@ -11,8 +11,9 @@ import tempfile from ansys.pyaedt.examples.constants import EDB_VERSION -import pyaedt -from pyaedt.edb_core.edb_data.control_file import ControlFile +import pyedb +from pyedb.dotnet.edb_core.edb_data.control_file import ControlFile +from pyedb.misc.downloads import download_file # - @@ -32,7 +33,7 @@ gds_fn = "sky130_fictitious_dtc_example.gds" layer_map = "dummy_layermap.map" -local_path = pyaedt.downloads.download_file("gds", destination=temp_dir.name) +local_path = download_file("gds", destination=temp_dir.name) c_file_in = os.path.join(local_path, control_fn) c_map = os.path.join(local_path, layer_map) gds_in = os.path.join(local_path, gds_fn) @@ -93,13 +94,11 @@ # Import the gds and open the edb. # + -from pyaedt import Edb - -# Select EDB version (change it manually if needed, e.g. "2023.2") +# Select EDB version (change it manually if needed, e.g. "2024.1") edb_version = EDB_VERSION print(f"EDB version: {edb_version}") -edb = Edb( +edb = pyedb.Edb( gds_out, edbversion=edb_version, technology_file=os.path.join(temp_dir.name, "output.xml") ) # - diff --git a/examples/00-EDB/11_post_layout_parameterization.py b/examples/EDB/11_post_layout_parameterization.py similarity index 90% rename from examples/00-EDB/11_post_layout_parameterization.py rename to examples/EDB/11_post_layout_parameterization.py index 30a5d40ee..deb039b2e 100644 --- a/examples/00-EDB/11_post_layout_parameterization.py +++ b/examples/EDB/11_post_layout_parameterization.py @@ -15,19 +15,20 @@ import tempfile from ansys.pyaedt.examples.constants import EDB_VERSION -import pyaedt +import pyedb +from pyedb.misc.downloads import download_file temp_dir = tempfile.TemporaryDirectory(suffix=".ansys") # Download and open example layout file in edb format. -edb_path = pyaedt.downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_dir.name) +edb_path = download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_dir.name) -# Select EDB version (change it manually if needed, e.g. "2023.2") +# Select EDB version (change it manually if needed, e.g. "2024.1") edb_version = EDB_VERSION print(f"EDB version: {edb_version}") -edb = pyaedt.Edb(edb_path, edbversion=edb_version) +edb = pyedb.Edb(edb_path, edbversion=edb_version) # - # ## Create cutout diff --git a/examples/00-EDB/12_edb_sma_connector_on_board.py b/examples/EDB/12_edb_sma_connector_on_board.py similarity index 96% rename from examples/00-EDB/12_edb_sma_connector_on_board.py rename to examples/EDB/12_edb_sma_connector_on_board.py index ddfe361bc..d240575e0 100644 --- a/examples/00-EDB/12_edb_sma_connector_on_board.py +++ b/examples/EDB/12_edb_sma_connector_on_board.py @@ -21,6 +21,8 @@ from ansys.pyaedt.examples.constants import EDB_VERSION import numpy as np import pyaedt +import pyedb +from pyedb.misc.downloads import download_file # Create the EDB. @@ -28,14 +30,14 @@ temp_dir = tempfile.TemporaryDirectory(suffix=".ansys") working_folder = temp_dir.name -# Select EDB version (change it manually if needed, e.g. "2023.2") +# Select EDB version (change it manually if needed, e.g. "2024.1") edb_version = EDB_VERSION print(f"EDB version: {edb_version}") aedb_path = os.path.join(working_folder, "pcb.aedb") print("AEDB file is located in {}".format(aedb_path)) -edb = pyaedt.Edb(edbpath=aedb_path, edbversion=edb_version) +edb = pyedb.Edb(edbpath=aedb_path, edbversion=edb_version) # - # Add the FR4 dielectric for the PCB. @@ -189,7 +191,7 @@ # Place a 3D component. -full_comp_name = pyaedt.downloads.download_file( +full_comp_name = download_file( "component_3d", filename="SMA_RF_SURFACE_MOUNT.a3dcomp", destination=working_folder ) comp = h3d.modeler.place_3d_component( diff --git a/examples/00-EDB/13_edb_create_component.py b/examples/EDB/13_edb_create_component.py similarity index 98% rename from examples/00-EDB/13_edb_create_component.py rename to examples/EDB/13_edb_create_component.py index c5c590183..c7a39a6ff 100644 --- a/examples/00-EDB/13_edb_create_component.py +++ b/examples/EDB/13_edb_create_component.py @@ -33,12 +33,12 @@ from ansys.pyaedt.examples.constants import EDB_VERSION import pyaedt -from pyaedt import Edb +from pyedb import Edb temp_dir = tempfile.TemporaryDirectory(suffix=".ansys") aedb_path = os.path.join(temp_dir.name, "component_example.aedb") -# Select EDB version (change it manually if needed, e.g. "2023.2") +# Select EDB version (change it manually if needed, e.g. "2024.1") edb_version = EDB_VERSION print(f"EDB version: {edb_version}") @@ -227,7 +227,7 @@ edb.save_edb() edb.close_edb() h3d = pyaedt.Hfss3dLayout( - specified_version="2023.2", + specified_version="2024.1", projectname=aedb_path, non_graphical=False, # Set non_graphical = False to launch AEDT in graphical mode. new_desktop_session=True, diff --git a/examples/00-EDB/14_edb_create_parametrized_design.py b/examples/EDB/14_edb_create_parametrized_design.py similarity index 91% rename from examples/00-EDB/14_edb_create_parametrized_design.py rename to examples/EDB/14_edb_create_parametrized_design.py index 802c2b425..ce98d2bff 100644 --- a/examples/00-EDB/14_edb_create_parametrized_design.py +++ b/examples/EDB/14_edb_create_parametrized_design.py @@ -15,19 +15,21 @@ from ansys.pyaedt.examples.constants import EDB_VERSION import pyaedt +import pyedb +from pyedb.misc.downloads import download_file -# ## Create an instance of a pyaedt.Edb object. +# ## Create an instance of a pyedb.Edb object. # + temp_dir = tempfile.TemporaryDirectory(suffix=".ansys") -target_aedb = pyaedt.downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_dir.name) +target_aedb = download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_dir.name) print("Project is located in ", target_aedb) -# Select EDB version (change it manually if needed, e.g. "2023.2") +# Select EDB version (change it manually if needed, e.g. "2024.1") edb_version = EDB_VERSION print(f"EDB version: {edb_version}") -edb = pyaedt.Edb(edbpath=target_aedb, edbversion=edb_version) +edb = pyedb.Edb(edbpath=target_aedb, edbversion=edb_version) print("AEDB file is located in {}".format(target_aedb)) # - diff --git a/examples/00-EDB/15_ac_analysis.py b/examples/EDB/15_ac_analysis.py similarity index 92% rename from examples/00-EDB/15_ac_analysis.py rename to examples/EDB/15_ac_analysis.py index d9b48248a..d90732847 100644 --- a/examples/00-EDB/15_ac_analysis.py +++ b/examples/EDB/15_ac_analysis.py @@ -16,6 +16,8 @@ from ansys.pyaedt.examples.constants import EDB_VERSION import pyaedt +import pyedb +from pyedb.misc.downloads import download_file # ### Download file # @@ -23,7 +25,7 @@ # + temp_dir = tempfile.TemporaryDirectory(suffix=".ansys") -edb_full_path = pyaedt.downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_dir.name) +edb_full_path = download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_dir.name) time.sleep(5) print(edb_full_path) @@ -31,14 +33,14 @@ # ### Configure EDB # -# Create an instance of the ``pyaedt.Edb`` class. +# Create an instance of the ``pyedb.Edb`` class. # + -# Select EDB version (change it manually if needed, e.g. "2023.2") +# Select EDB version (change it manually if needed, e.g. "2024.1") edb_version = EDB_VERSION print(f"EDB version: {edb_version}") -edbapp = pyaedt.Edb(edbpath=edb_full_path, edbversion=edb_version) +edbapp = pyedb.Edb(edbpath=edb_full_path, edbversion=edb_version) # - # ### Generate extended nets @@ -142,7 +144,7 @@ h3d = pyaedt.Hfss3dLayout( edb_full_path, - specified_version="2023.2", + specified_version="2024.1", non_graphical=False, # Set to true for non-graphical mode. new_desktop_session=True, ) diff --git a/examples/00-EDB/_static/connector_example.png b/examples/EDB/_static/connector_example.png similarity index 100% rename from examples/00-EDB/_static/connector_example.png rename to examples/EDB/_static/connector_example.png diff --git a/examples/00-EDB/_static/diff_via.png b/examples/EDB/_static/diff_via.png similarity index 100% rename from examples/00-EDB/_static/diff_via.png rename to examples/EDB/_static/diff_via.png diff --git a/examples/00-EDB/_static/edb_example_12_sma_connector_on_board.png b/examples/EDB/_static/edb_example_12_sma_connector_on_board.png similarity index 100% rename from examples/00-EDB/_static/edb_example_12_sma_connector_on_board.png rename to examples/EDB/_static/edb_example_12_sma_connector_on_board.png diff --git a/examples/00-EDB/_static/parameterized_design.png b/examples/EDB/_static/parameterized_design.png similarity index 100% rename from examples/00-EDB/_static/parameterized_design.png rename to examples/EDB/_static/parameterized_design.png diff --git a/examples/00-EDB/_static/pcb_transition_parameterized.png b/examples/EDB/_static/pcb_transition_parameterized.png similarity index 100% rename from examples/00-EDB/_static/pcb_transition_parameterized.png rename to examples/EDB/_static/pcb_transition_parameterized.png diff --git a/examples/00-EDB/index.rst b/examples/EDB/index.rst similarity index 90% rename from examples/00-EDB/index.rst rename to examples/EDB/index.rst index b989ef9ed..96ebfce17 100644 --- a/examples/00-EDB/index.rst +++ b/examples/EDB/index.rst @@ -3,7 +3,7 @@ EDB examples ~~~~~~~~~~~~ -These examples use EDB (Electronics Database) with PyAEDT. +These examples use EDB (Electronics Database) with PyEDB and PyAEDT. EDB is a flexible API that provides efficient control of PCB data. The EDB can be used standalone or in combination with the electronics desktop user interface. diff --git a/pyproject.toml b/pyproject.toml index bc099e70b..34a102ff6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ classifiers = [ dependencies = [ "build==1.0.3", "numpy", - "pyaedt==0.7.12", + "pyaedt==0.8.1", "twine==5.0.0", "pydantic", "pyvista", diff --git a/src/ansys/pyaedt/examples/constants.py b/src/ansys/pyaedt/examples/constants.py index 03ce11696..a55c17f18 100644 --- a/src/ansys/pyaedt/examples/constants.py +++ b/src/ansys/pyaedt/examples/constants.py @@ -22,8 +22,8 @@ """Constants used in PyAEDT examples. """ -AEDT_VERSION = "2023.2" -EDB_VERSION = "2023.2" +AEDT_VERSION = "2024.1" +EDB_VERSION = "2024.1" HEADER = """# Copyright (C) 2024 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT @@ -58,7 +58,7 @@ import tempfile from ansys.pyaedt.examples.constants import EDB_VERSION -from pyaedt import Edb +from pyedb import Edb # -""" EDB_TMP_DIR = r"""# Create and return a temporary directory diff --git a/src/ansys/pyaedt/examples/templates/template_edb.j2 b/src/ansys/pyaedt/examples/templates/template_edb.j2 index 92b4653b6..93c9d3730 100644 --- a/src/ansys/pyaedt/examples/templates/template_edb.j2 +++ b/src/ansys/pyaedt/examples/templates/template_edb.j2 @@ -17,11 +17,11 @@ {{ step_download.code }} {% endif %} -# ## Create an instance of the Electronics Database using the `pyaedt.Edb` class. +# ## Create an instance of the Electronics Database using the `pyedb.Edb` class. # # > Note that units are SI. -# Select EDB version (change it manually if needed, e.g. "2023.2") +# Select EDB version (change it manually if needed, e.g. "2024.1") edb_version = {{ edb_version }} print(f"EDB version: {edb_version}") diff --git a/tests/test_edb_writer.py b/tests/test_edb_writer.py index dcdc09723..d0a1d8730 100644 --- a/tests/test_edb_writer.py +++ b/tests/test_edb_writer.py @@ -22,11 +22,11 @@ {EDB_TMP_DIR} -# ## Create an instance of the Electronics Database using the `pyaedt.Edb` class. +# ## Create an instance of the Electronics Database using the `pyedb.Edb` class. # # > Note that units are SI. -# Select EDB version (change it manually if needed, e.g. "2023.2") +# Select EDB version (change it manually if needed, e.g. "2024.1") edb_version = {EDB_VERSION} print(f"EDB version: {{edb_version}}")