Skip to main content

Higher-Level Pythonic Ansys Electronics Desktop Framework

Project description

PyAEDT


English | 中文

PyAnsys pypi PyPIact PythonVersion GH-CI codecov MITblackAnaconda pre-commit

What is PyAEDT?

PyAEDT is a Python library that interacts directly with the API for Ansys Electronics Desktop (AEDT) to make scripting simpler. The architecture for PyAEDT can be reused for all AEDT 3D products (HFSS, Icepak, Maxwell 3D, and Q3D Extractor), 2D tools, and Ansys Mechanical. PyAEDT also provides support for circuit tools like Nexxim and system simulation tools like Twin Builder. Finally, PyAEDT provides scripting capabilities in Ansys layout tools like HFSS 3D Layout and EDB. The PyAEDT class and method structures simplify operation while reusing information as much as possible across the API.

Install on CPython from PyPI

You can install PyAEDT on CPython 3.7 through 3.10 from PyPI with this command:

  pip install pyaedt

Install PyAEDT with all extra packages (matplotlib, numpy, pandas, pyvista):

  pip install pyaedt[full]

You can also install PyAEDT from Conda-Forge with this command:

  conda install -c conda-forge pyaedt

PyAEDT remains compatible with IronPython and can be still used in the AEDT Framework.

About PyAnsys

PyAEDT is part of the larger PyAnsys effort to facilitate the use of Ansys technologies directly from Python.

PyAEDT is intended to consolidate and extend all existing functionalities around scripting for AEDT to allow reuse of existing code, sharing of best practices, and increased collaboration.

About AEDT

AEDT is a platform that enables true electronics system design. AEDT provides access to the Ansys gold-standard electro-magnetics simulation solutions, such as Ansys HFSS, Ansys Maxwell, Ansys Q3D Extractor, Ansys Siwave, and Ansys Icepak using electrical CAD (ECAD) and Mechanical CAD (MCAD) workflows.

In addition, AEDT includes direct links to the complete Ansys portfolio of thermal, fluid, and mechanical solvers for comprehensive multiphysics analysis. Tight integration among these solutions provides unprecedented ease of use for setup and faster resolution of complex simulations for design and optimization.

PyAEDT is licensed under the MIT License

PyAEDT includes functionality for interacting with the following AEDT tools and Ansys products:

  • HFSS and HFSS 3D Layout
  • Icepak
  • Maxwell 2D, Maxwell 3D, and RMXprt
  • 2D Extractor and Q3D Extractor
  • Mechanical
  • Nexxim
  • EDB
  • Twin Builder

Documentation and issues

Documentation for the latest stable release of PyAEDT is hosted at PyAEDT documentation.

In the upper right corner of the documentation's title bar, there is an option for switching from viewing the documentation for the latest stable release to viewing the documentation for the development version or previously released versions.

You can also view or download PyAEDT cheat sheets, which are one-page references providing syntax rules and commands for using the PyAEDT API and PyEDB API:

On the PyAEDT Issues page, you can create issues to report bugs and request new features. On the PyAEDT Discussions page or the Discussions page on the Ansys Developer portal, you can post questions, share ideas, and get community feedback.

To reach the project support team, email pyansys.core@ansys.com.

Dependencies

To run PyAEDT, you must have a local licenced copy of AEDT. PyAEDT supports AEDT versions 2022 R1 or newer.

Student version

PyAEDT supports AEDT Student versions 2022 R1 and later. For more information, see the Ansys Electronics Desktop Student - Free Software Download page on the Ansys website.

Why PyAEDT?

A quick and easy approach for automating a simple operation in the AEDT UI is to record and reuse a script. However, disadvantages of this approach are:

  • Recorded code is dirty and difficult to read and understand.
  • Recorded scripts are difficult to reuse and adapt.
  • Complex coding is required by many global users of AEDT.

The main advantages of PyAEDT are:

  • Automatic initialization of all AEDT objects, such as desktop objects like the editor and boundaries
  • Error management
  • Log management
  • Variable management
  • Compatibility with IronPython and CPython
  • Simplification of complex API syntax using data objects while maintaining PEP8 compliance.
  • Code reusability across different solvers
  • Clear documentation on functions and API
  • Unit tests of code to increase quality across different AEDT versions

Example workflow

  1. Initialize the Desktop class with the version of AEDT to use.
  2. Initialize the application to use within AEDT.

Connect to AEDT from Python IDE

PyAEDT works both inside AEDT and as a standalone application. This Python library automatically detects whether it is running in an IronPython or CPython environment and initializes AEDT accordingly. PyAEDT also provides advanced error management. Usage examples follow.

Explicit AEDT declaration and error management

    # Launch AEDT 2022 R2 in non-graphical mode

    from pyaedt import Desktop, Circuit
    with Desktop(specified_version="2022.2",
                 non_graphical=False, new_desktop_session=True,
                 close_on_exit=True, student_version=False):
        circuit = Circuit()
        ...
        # Any error here will be caught by Desktop.
        ...

    # Desktop is automatically released here.

Implicit AEDT declaration and error management

    # Launch the latest installed version of AEDT in graphical mode

    from pyaedt import Circuit
    with Circuit(specified_version="2022.2",
                 non_graphical=False) as circuit:
        ...
        # Any error here will be caught by Desktop.
        ...

    # Desktop is automatically released here.

Remote application call

You can make a remote application call on a CPython server or any Windows client machine.

On a CPython Server:

    # Launch PyAEDT remote server on CPython

    from pyaedt.common_rpc import pyaedt_service_manager
    pyaedt_service_manager()

On any Windows client machine:

    from pyaedt.common_rpc import create_session
    cl1 = create_session("server_name")
    cl1.aedt(port=50000, non_graphical=False)
    hfss = Hfss(machine="server_name", port=50000)
    # your code here

Variables

    from pyaedt.HFSS import HFSS
    with HFSS as hfss:
         hfss["dim"] = "1mm"   # design variable
         hfss["$dim"] = "1mm"  # project variable

Modeler

    # Create a box, assign variables, and assign materials.

    from pyaedt.hfss import Hfss
    with Hfss as hfss:
         hfss.modeler.create_box([0, 0, 0], [10, "dim", 10],
                                 "mybox", "aluminum")

License

PyAEDT is licensed under the MIT license.

PyAEDT makes no commercial claim over Ansys whatsoever. This library extends the functionality of AEDT by adding a Python interface to AEDT without changing the core behavior or license of the original software. The use of PyAEDT requires a legally licensed local copy of AEDT.

To get a copy of AEDT, see the Ansys Electronics page on the Ansys website.

back to top

Indices and tables

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyaedt-0.6.94.tar.gz (3.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyaedt-0.6.94-py3-none-any.whl (3.5 MB view details)

Uploaded Python 3

File details

Details for the file pyaedt-0.6.94.tar.gz.

File metadata

  • Download URL: pyaedt-0.6.94.tar.gz
  • Upload date:
  • Size: 3.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.5

File hashes

Hashes for pyaedt-0.6.94.tar.gz
Algorithm Hash digest
SHA256 0a15a2ac1bd0ff47ee780ff63459381d8370e7bc18d1b8193104af55a8ca8a16
MD5 befbc62b213a9fd8e1fd176ba18ddda2
BLAKE2b-256 e45c4b17d19030faaa471a5d484f7e0c34504029d8a2c77c55f76394e709892f

See more details on using hashes here.

File details

Details for the file pyaedt-0.6.94-py3-none-any.whl.

File metadata

  • Download URL: pyaedt-0.6.94-py3-none-any.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.5

File hashes

Hashes for pyaedt-0.6.94-py3-none-any.whl
Algorithm Hash digest
SHA256 6b0b163de0c38de7ef0f772e1ef091372dfe1bbd612bf712361ee8ad79f9c58a
MD5 46b02d85c7e36a49ab40d0376ef2c020
BLAKE2b-256 ffafa9b432edc1701ddc42dad864b67b78007d4070ab93c063b78b05c29cce32

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page