Skip to content

Commit

Permalink
Merge pull request #30 from ansys-internal/doc
Browse files Browse the repository at this point in the history
first init edb. Waiting for pyedb bug fix
  • Loading branch information
svandenb-dev authored Oct 23, 2023
2 parents 4a62618 + dac8d69 commit c0f6ae4
Show file tree
Hide file tree
Showing 46 changed files with 85 additions and 617 deletions.
4 changes: 2 additions & 2 deletions doc/source/EDBAPI/ComponentsEdb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ The main component object is called directly from main application using the pro

.. code:: python
from pyaedt import Edb
from pyedb import Edb
edb = Edb(myedb, edbversion="2023.1")
pins =edb.components.get_pin_from_component("U2A5")
...
.. currentmodule:: pyaedt.edb_core.components
.. currentmodule:: pyedb.edb_core.components

.. autosummary::
:toctree: _autosummary
Expand Down
2 changes: 1 addition & 1 deletion doc/source/Getting_started/About.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ assign materials, define ports, simulations and constraints and then launch any
the various electromagnetic simulators: HFSS, HFSS3Dlayout, SIwave, Icepak, Maxwell, Q3D.

AEDB is running as stand alone API and opens aedb folder for directly querying and manipulating
layout design in memory and does not require to open any User Interface (UI). Hence AEDB is the fastest
layout design in memory and does not require opening any User Interface (UI). Hence AEDB is the fastest
and most efficient way to handle large and complex layout.

AEDB can also been parsed with and Electromagnetic simulator command line like HFSS or SIwave in bacth.
Expand Down
6 changes: 3 additions & 3 deletions doc/source/Getting_started/Contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ page to submit questions, report bugs, and request new features.

To reach the product support team, email `[email protected] <[email protected]>`_.

View PyAEDT documentation
View PyEDB documentation
-------------------------
Documentation for the latest stable release of PyAEDT is hosted at
`PyAEDT Documentation <https://aedt.docs.pyansys.com>`_.
Expand Down Expand Up @@ -73,7 +73,7 @@ For example::

Log errors
~~~~~~~~~~
PyAEDT has an internal logging tool named ``Messenger``
PyEDB has an internal logging tool named ``Messenger``
and a log file that is automatically generated in the project
folder.

Expand Down Expand Up @@ -120,7 +120,7 @@ Here is an example of an error:
.. code::
----------------------------------------------------------------------------------
PyAEDT error on method create_box: General or AEDT error. Check again
PyEDB error on method create_box: General or EDB error. Check again
the arguments provided:
position = [0, 0, 0]
dimensions_list = [0, 10, 10]
Expand Down
166 changes: 22 additions & 144 deletions doc/source/Getting_started/Installation.rst
Original file line number Diff line number Diff line change
@@ -1,51 +1,35 @@
Installation
============
PyAEDT consolidates and extends all existing capital around scripting for AEDT,
PyEDB consolidates and extends all existing capital around scripting for AEDB,
allowing re-use of existing code, sharing of best practices, and collaboration.

This PyAnsys library has been tested on HFSS, Icepak, and Maxwell 3D. It also provides
basic support for EDB and Circuit (Nexxim).
This PyAnsys library has been tested on HFSS, Icepak, SIWave.

Requirements
~~~~~~~~~~~~
In addition to the runtime dependencies listed in the installation information, PyAEDT
requires Ansys Electronics Desktop (AEDT) 2022 R1 or later. The AEDT Student Version is also supported.
In addition to the runtime dependencies listed in the installation information, PyEDB
requires Ansys Electronics Desktop (AEDT) 2023 R2 or later.



Install from a Python file
~~~~~~~~~~~~~~~~~~~~~~~~~~
AEDT already includes CPython 3.7, which can be used to run PyAEDT.
It is also possible to use CPython 3.7 (3.10 from AEDT 2023R2) as a virtual environment to run PyAEDT.
AEDT already includes CPython 3.7, which can be used to run PyEDB.
It is also possible to use CPython 3.7 (3.10 from AEDT 2023R2) as a virtual environment to run PyEDB.
In order to do that you can download the following file
:download:`PyAEDT Installer Python file <../Resources/PyAEDTInstallerFromDesktop.py>`
Open an Electronics Desktop Session and click on Tools->Run Script and execute the file.

Offline install is also possible using wheelhouses.
A wheelhouse is a zip containing all needed packages that can be installed offline.
PyAEDT wheelhouse can be found at `Releases <https://github.com/ansys/pyaedt/releases>`_.
PyEDB wheelhouse can be found at `Releases <https://github.com/ansys/pyaedt/releases>`_.
After downloading the wheelhouse zip specific for your distribution and Python release,
run the script from Electronics Desktop using the zip full path as argument.
Please note that AEDT 2023 R1 and lower requires Python 3.7 wheelhouse while AEDT 2023 R2
and higher requires the Python 3.10 wheelhouse.

After installation a new menu appears in AEDT Menu as in the image below.

.. image:: ../Resources/toolkits.png
:width: 800
:alt: PyAEDT toolkit installed after batch run


Starting from 2023R2, a Ribbon button is available in Automation Tab as in the example below.

.. image:: ../Resources/toolkits_ribbon.png
:width: 800
:alt: PyAEDT toolkit buttons available in AEDT 2023.2 after batch run
run the script from Python terminal with providing the zip full path as argument.


Build Toolkits with PyAEDT
~~~~~~~~~~~~~~~~~~~~~~~~~~
Build Toolkits with PyEDB
~~~~~~~~~~~~~~~~~~~~~~~~~
You can create and install external toolkits.
The template provides a framework to create your own toolkits using PyAEDT.
The template provides a framework to create your own toolkits using PyEDB.
The template can be found at `Template <https://aedt.toolkit.template.docs.pyansys.com/>`_.

.. image:: ../Resources/template_ribbon.png
Expand All @@ -54,23 +38,17 @@ The template can be found at `Template <https://aedt.toolkit.template.docs.pyans

Install on CPython from PyPI
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can install PyAEDT on CPython 3.7 through 3.10 from PyPI:
You can install PyEDB on CPython 3.7 through 3.10 from PyPI:

.. code:: python
pip install pyaedt
You can also install PyAEDT from Conda-Forge:

.. code:: python
conda install -c conda-forge pyaedt
pip install pyansys-edb
Linux support
~~~~~~~~~~~~~

PyAEDT works with CPython 3.7 through 3.10 on Linux in AEDT 2022 R2 and later.
PyEDB works with CPython 3.7 through 3.10 on Linux in AEDT 2022 R2 and later.
However, you must set up the following environment variables:

.. code::
Expand All @@ -82,124 +60,24 @@ However, you must set up the following environment variables:
Install offline from a wheelhouse
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Using a wheelhouse can be helpful if you work for a company that restricts access to external networks.
Wheelhouses for CPython 3.7, 3.8, and 3.9 are available in the releases for PyAEDT v0.4.70
and later for both Windows and Linux. From the `Releases <https://github.com/ansys/pyaedt/releases>`_
page in the PyAEDT repository, you can find the wheelhouses for a particular release in its
Wheelhouses for CPython 3.7, 3.8, and 3.9 are available in the releases for PyEDB v1.0
and later for both Windows and Linux. From the `Releases <https://github.com/ansys/pyansys-edb/releases>`_
page in the PyEDB repository, you can find the wheelhouses for a particular release in its
assets and download the wheelhouse specific to your setup.

You can then install PyAEDT and all of its dependencies from one single entry point that can be shared internally,
You can then install PyEDB and all of its dependencies from one single entry point that can be shared internally,
which eases the security review of the PyAEDT package content.

For example, on Windows with Python 3.7, install PyAEDT and all its dependencies from a wheelhouse with code like this:

.. code::
pip install --no-cache-dir --no-index --find-links=file:///<path_to_wheelhouse>/PyAEDT-v<release_version>-wheelhouse-Windows-3.7 pyaedt
Install from a batch file
~~~~~~~~~~~~~~~~~~~~~~~~~
If you are running on Windows, you can download
:download:`PyAEDT Environment with IDE bat file <../Resources/pyaedt_with_IDE.bat>`
and run this batch file on your local machine. Using this approach
provides you with a complete integrated development environment (IDE)
for writing PyAEDT scripts in Windows with a simple batch file.

This batch file executes these steps:

1. Creates a Python virtual environment in your ``%APPDATA%`` folder. To accomplish
this, it uses CPython in the selected version of AEDT available on your machine.
2. Installs PyAEDT.
3. Optionally installs `Spyder <https://www.spyder-ide.org/>`_ with -s flag.
4. Installs `Jupyter Lab <https://jupyter.org/>`_.
5. Creates a symbolic link from your PyAEDT installation to AEDT ``PersonalLib`` so
that scripts can also be run within AEDT.
6. Updates PyAEDT.
7. Install PyAEDT toolkit in AEDT to enable PyAEDT Console and PyAEDT Run Script.
8. Runs the tool that you choose (Spyder, Jupyter Lab, or a simple console).

.. image:: ../Resources/toolkits.png
:width: 800
:alt: PyAEDT toolkit installed after batch run

Steps 1 through 5 are executed only the first time that you run the batch file or when ``-f`` is used:

.. code::
pyaedt_with_IDE.bat --force-install
pyaedt_with_IDE.bat -f
Step 6 is executed only when running the command with the ``-update`` option:

.. code::
pyaedt_with_IDE.bat --update
pyaedt_with_IDE.bat -u
Optionally, you can decide to pass a Python path. This path is then used to create a virtual environment:

.. code::
pyaedt_with_IDE.bat -f -p <path-to-python-root-folder>
In addition, it is possible to install the PyAEDT package and all its dependencies provided in the wheelhouse by
executing the batch file mentioned earlier. You must use the Wheelhouse 3.7 package if no Python path is provided.
Otherwise, you must download and use the correct wheelhouse:
For example, on Windows with Python 3.7, install PyEDB and all its dependencies from a wheelhouse with code like this:

.. code::
pyaedt_with_IDE.bat-w <path_to_wheelhouse>PyAEDT-v<release_version>-wheelhouse-Windows-3.7
pyaedt_with_IDE.bat -p <path-to-python3.8-root-folder> -w <path_to_wheelhouse>PyAEDT-v<release_version>-wheelhouse-Windows-3.8
pyaedt_with_IDE.bat -p <path-to-python3.7-root-folder> -w <path_to_wheelhouse>PyAEDT-v<release_version>-wheelhouse-Windows-3.7
pyaedt_with_IDE.bat -p <path-to-python3.9-root-folder> -w <path_to_wheelhouse>PyAEDT-v<release_version>-wheelhouse-Windows-3.9
Use IronPython in AEDT
~~~~~~~~~~~~~~~~~~~~~~
PyAEDT is designed to work in CPython 3.7+ and supports many advanced processing packages like
``matplotlib``, ``numpy``, and ``pyvista``. A user can still use PyAEDT in the IronPython
environment available in AEDT with many limitations.

To use IronPython in AEDT:

1. Download the PyAEDT package from ``https://pypi.org/project/pyaedt/#files``.
2. Extract the files.
3. Install PyAEDT into AEDT, specifying the full paths to ``ipy64`` and ``setup-distutils.py`` as needed:

.. code::
ipy64 setup-distutils.py install --user
Install PyAEDT in Conda virtual environment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Create virtual environment

.. code:: bash
conda create --name pyaedt_py310 python=3.10
Activate virtual environment

.. code:: bash
conda activate pyaedt_py310
Install required packages.

Download `requirements.txt <https://github.com/ansys/pyaedt/blob/main/requirements/requirements.txt>`_

.. code:: bash
pip install --no-cache-dir --no-index --find-links=file:///<path_to_wheelhouse>/PyEDB-v<release_version>-wheelhouse-Windows-3.7 pyaedt
pip install -r requirements.txt
Upgrade PyAEDT to the latest version
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: bash
pip install -U pyaedt
pip install -U pyansys-edb
26 changes: 10 additions & 16 deletions doc/source/Getting_started/Quickcode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Quick Code

Documentation and issues
------------------------
Documentation for the latest stable release of PyAEDT is hosted at
`PyAEDT documentation <https://aedt.docs.pyansys.com/version/stable/>`_.
Documentation for the latest stable release of PyEDB is hosted at
`PyEDB documentation <https://aedt.docs.pyansys.com/version/stable/>`_.

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
Expand All @@ -14,33 +14,27 @@ 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:

- `View PyAEDT cheat sheet <https://cheatsheets.docs.pyansys.com/pyaedt_API_cheat_sheet.png>`_ or
`download PyAEDT cheat sheet <https://cheatsheets.docs.pyansys.com/pyaedt_API_cheat_sheet.pdf>`_ the
PyAEDT API cheat sheet.

- `View EDB cheat sheet <https://cheatsheets.docs.pyansys.com/pyedb_API_cheat_sheet.png>`_ or
`download EDB cheat sheet <https://cheatsheets.docs.pyansys.com/pyedb_API_cheat_sheet.pdf>`_ the
- `View PyEDB cheat sheet <https://cheatsheets.docs.pyansys.com/pyedb_API_cheat_sheet.png>`_ or
`download PyEDB cheat sheet <https://cheatsheets.docs.pyansys.com/pyedb_API_cheat_sheet.pdf>`_ the
PyAEDT API cheat sheet.


On the `PyAEDT Issues <https://github.com/ansys/PyAEDT/issues>`_ page, you can
create issues to report bugs and request new features. On the `PyAEDT Discussions
<https://github.com/ansys/pyaedt/discussions>`_ page or the `Discussions <https://discuss.ansys.com/>`_
On the `PyEDB Issues <https://github.com/ansys/Pansys-edb/issues>`_ page, you can
create issues to report bugs and request new features. On the `PyEDB Discussions
<https://github.com/ansys/pyansys-edb/discussions>`_ page or the `Discussions <https://discuss.ansys.com/>`_
page on the Ansys Developer portal, you can post questions, share ideas, and get community feedback.

To reach the project support team, email `[email protected] <[email protected]>`_.


Example workflow
----------------
Here’s a brief example of how PyAEDT works:
Here’s a brief example of how PyEDB works:

Connect to AEDT from a Python IDE
---------------------------------
PyAEDT works both inside AEDT and as a standalone app.
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.
PyEDB works both inside AEDT and as a standalone app.
PyEDB also provides advanced error management. Usage examples follow.

Explicit AEDT declaration and error management
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
32 changes: 8 additions & 24 deletions doc/source/Getting_started/Troubleshooting.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Troubleshooting
===============
This section contains common issues and suggestions related to installation and use of PyAEDT.
This section contains common issues and suggestions related to installation and use of PyEDB.

Installation
~~~~~~~~~~~~
Expand All @@ -21,7 +21,7 @@ Here is the path to the Python 3.7 interpreter for the 2023 R1 installation:
path\to\AnsysEM\v231\commonfiles\CPython\3_7\winx64\Release\python"
Error installing PyAEDT using pip
Error installing PyEDB using pip
---------------------------------
- **Proxy server**: If your company uses a proxy server, you may have to update proxy
settings at the command line. For more information, see the `Using a Proxy
Expand All @@ -46,30 +46,14 @@ run the Python command:

.. code:: python
>>> pip install --no-cache-dir --no-index --find-links=/path/to/pyaedt/wheelhouse pyaedt
>>> pip install --no-cache-dir --no-index --find-links=/path/to/pyaedt/wheelhouse pyansys-edb
Another option to install PyAEDT from the wheelhouse is to download the following file
:download:`PyAEDT Installer Python file <../Resources/PyAEDTInstallerFromDesktop.py>`.
Run this script directly from AEDT and pass the wheelhouse file name as an argument.




Run PyAEDT
~~~~~~~~~~

COM vs gRPC
-----------
Prior to the 2022R2 release CPython automation in AEDT used
`COM <https://learn.microsoft.com/en-us/windows/win32/com/com-objects-and-interfaces>`_ which
requires all interfaces to be registered in the Windows Registry.
Communication between Python and the AEDT API were translated through an intermediate layer using
`pywin32 <https://github.com/mhammond/pywin32>`_ and `PythonNET <https://pythonnet.github.io/pythonnet/>`_.

Run PyEDB with gRPC
~~~~~~~~~~~~~~~~~~~
`gRPC <https://grpc.io/>`_ is a modern open source high performance Remote Procedure Call (RPC)
framework that can run in any environment and supports client/server remote calls.
Starting from 2022R2 the AEDT API has replaced the COM interface with a gRPC interface.
Starting from 2024R1 the EDB-core API has replaced the .NET interface with a gRPC interface.


.. list-table:: *gRPC Compatibility:*
Expand All @@ -92,7 +76,7 @@ On Linux, the Python interface to AEDT uses gRPC for all versions.

Check the AEDT API configuration
--------------------------------
Run the following command to start AEDT as a gRPC server:
Run the following command to start PyEDB as a gRPC server:

*Windows:*

Expand Down Expand Up @@ -195,6 +179,6 @@ gRPC calls on the client where the Python script is to be run.
export GRPC_VERBOSITY=DEBUG
export GRPC_TRACE=all
Now run the PyAEDT script, (making sure it connects to the same port as the gRPC server - 50051).
Now run the PyEB script, (making sure it connects to the same port as the gRPC server - 50051).
Capture the output in a file. For example *client.txt*. Then send all the logs
to `Ansys Support <https://www.ansys.com/it-solutions/contacting-technical-support>`_.
Loading

0 comments on commit c0f6ae4

Please sign in to comment.