Giter Site home page Giter Site logo

wishalpha / pyaedt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ansys/pyaedt

0.0 0.0 0.0 52.17 MB

AEDT Python Client Package

Home Page: http://aedtdocs.pyansys.com

License: MIT License

Python 99.20% TypeScript 0.59% SourcePawn 0.09% Makefile 0.02% Batchfile 0.10%

pyaedt's Introduction

PyAEDT

PyAnsys pypi PyPIact GH-CI codecov MIT black

Introduction

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 Ansys Electronics Desktop (AEDT) to allow reuse of existing code, sharing of best practices, and increased collaboration. 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

What is PyAEDT?

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

Documentation and issues

In addition to installation, usage, and contribution information, the PyAEDT documentation provides API documentation, examples, and code guidelines.

On the PyAEDT Issues page, you can create issues to submit questions, report bugs, and request new features. To reach the project support team, email [email protected].

Dependencies

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

Student version

PyAEDT supports AEDT Student version 2021 R2. For more information, see Student Version page.

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, boundaries, and so on
  • 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 2021 R1 in non-graphical mode

from pyaedt import Desktop, Circuit
with Desktop(specified_version="2022.1",
             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.1",
             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.

This module makes no commercial claim over Ansys whatsoever. PyAEDT extends the functionality of AEDT by adding an additional Python interface to AEDT without changing the core behavior or license of the original software. The use of the interactive control of PyAEDT requires a legally licensed local copy of AEDT. For more information about AEDT, visit the AEDT page on the Ansys website.

pyaedt's People

Contributors

maxcapodi78 avatar pipkat avatar maxjprey avatar akaszynski avatar samuelopez-ansys avatar alberto-dm avatar svandenb-dev avatar dependabot[bot] avatar jleonatti avatar ring630 avatar gmalinve avatar beliaev-maksim avatar isaacansys avatar jeremich41 avatar voss70 avatar sushobhitgupt avatar koubaa avatar kbhagat-ansys avatar jianwei425 avatar dcrawforatansys avatar davetwyman avatar jorgepiloto avatar seeyouatcloudbase avatar adamtheengineer-dev avatar collinhough avatar germa89 avatar revathyvenugopal162 avatar sparfenyuk avatar zebanaqviwat avatar camuher avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.