diff --git a/README.rst b/README.rst index 94502b25de..620bc7d555 100644 --- a/README.rst +++ b/README.rst @@ -1,199 +1,57 @@ -Pyedb -===== - -Ansys Electronics Database Python Client - -.. image:: https://github.com/ansys/pyedb/actions/workflows/ci_cd.yml/badge.svg?branch=develop - :target: https://github.com/ansys/pyedb/actions/workflows/ci_cd.yml?query=branch%3Adevelop - -How to install --------------- - -At least two installation modes are provided: user and developer. - -[NOT RELEASED] For users -^^^^^^^^^^^^^^^^^^^^^^^^ - - - -In order to install Pyedb, make sure you -have the required build system tool. To do so, run: - -.. code:: bash - - python -m pip install -U pip - -Then, you can simply execute: - -.. code:: bash - - python -m pip install ansys-edb - -For developers -^^^^^^^^^^^^^^ - -Installing Pyedb in developer mode allows -you to modify the source and enhance it. - -Before contributing to the project, please refer to the `PyAnsys Developer's guide`_. You will -need to follow these steps: - -1. Start by cloning this repository: - - .. code:: bash - - git clone https://github.com/ansys/pyedb - cd pyedb - -2. Create a fresh-clean Python environment and activate it: - - .. code:: bash - - # Create a virtual environment - python -m venv .venv - - # Activate it in a Linux environment - python -m venv .venv && source .venv/bin/activate - - # Activate it in a Windows CMD environment - .venv\Scripts\activate.bat - - # Activate it in a Windows Powershell environment - .venv\Scripts\Activate.ps1 - - -3. Make sure you have the latest required build system and doc, testing, and CI tools: - - .. code:: bash - - python -m pip install -U pip tox - - # Copy default environment variables for test - cp .env.test.example .env.test - - # Modify .env.test if necessary - - -4. Finally, verify your development installation by running: - - .. code:: bash - - tox - - -How to testing --------------- - -This project takes advantage of `tox`_. This tool allows to automate common -development tasks (similar to Makefile) but it is oriented towards Python -development. - -Using tox -^^^^^^^^^ - -As Makefile has rules, `tox`_ has environments. In fact, the tool creates its -own virtual environment so anything being tested is isolated from the project in -order to guarantee project's integrity. The following environments commands are provided: - -- **tox -e style**: will check for coding style quality. -- **tox -e test**: checks for unit tests. Replace X with the minor version of your Python environment. Pass pytest flags after "--". For example, `tox -e py3X -- -s` to show stdout from pytest -- **tox -e coverage**: checks for code coverage. -- **tox -e doc**: checks for documentation building process. - - -Raw testing -^^^^^^^^^^^ - -If required, you can always call the style commands (`black`_, `isort`_, -`flake8`_...) or unit testing ones (`pytest`_) from the command line. However, -this does not guarantee that your project is being tested in an isolated -environment, which is the reason why tools like `tox`_ exist. - - -A note on pre-commit -^^^^^^^^^^^^^^^^^^^^ - -The style checks take advantage of `pre-commit`_. Developers are not forced but -encouraged to install this tool via: - -.. code:: bash - - python -m pip install pre-commit && pre-commit install - - -Documentation -------------- - -For building documentation, you can either run the usual rules provided in the -`Sphinx`_ Makefile, such us: - -.. code:: bash - - make -C doc/ html && your_browser_name doc/html/index.html - -However, the recommended way of checking documentation integrity is using: - -.. code:: bash - - tox -e doc && your_browser_name .tox/doc_out/html/index.html - - -Distributing ------------- - -If you would like to create either source or wheel files, then you can execute: - -.. code:: bash - - flit build - python -m twine check dist/* - -.. LINKS AND REFERENCES -.. _black: https://github.com/psf/black -.. _flake8: https://flake8.pycqa.org/en/latest/ -.. _isort: https://github.com/PyCQA/isort -.. _PyAnsys Developer's guide: https://dev.docs.pyansys.com/ -.. _pre-commit: https://pre-commit.com/ -.. _pytest: https://docs.pytest.org/en/stable/ -.. _Sphinx: https://www.sphinx-doc.org/en/master/ -.. _tox: https://tox.wiki/ - -Examples ------------- - -Examples in the form of jupyter notebooks are available to illustrate API usage. -Follow these steps as necessary to run the notebooks : - -1. Create and activate a virtual env (detailed instructions can be found above): - - .. code:: bash - - python -m venv .venv - .venv\Scripts\activate.bat - - -2. Build and Install the ansys-edb and ansys-api packages (ensure pip is upgraded) : - - .. code:: bash - - python -m pip install -e . - -3. Install notebook requirements : - - .. code:: bash - - python -m pip install .[notebook] - -4. Install ipython kernel : - - .. code:: bash - - ipython kernel install --user --name=.venv - -5. Launch notebook : - - .. code:: bash - - jupyter-notebook - -6. Navigate to the required example, change the kernel to .venv and execute with the desired settings. +PyEDB-Core +========== +.. image:: https://github.com/ansys/pyedb-core/actions/workflows/ci_cd.yml/badge.svg?branch=develop + :target: https://github.com/ansys/pyedb-core/actions/workflows/ci_cd.yml?query=branch%3Adevelop + +.. reuse_start + +PyEDB-Core is a Python client for the Electronics Database (EDB), a format for storing +information describing designs for Ansys Electronic Desktop (AEDT). Using the PyEDB-Core API, +you can make calls to an EDB server that is running either locally or remotely. + +The EDB server can create, edit, read, and write EDB files to disk. These files can then be +read into AEDT and their designs simulated. + +Documentation and issues +~~~~~~~~~~~~~~~~~~~~~~~~ +Documentation for the latest stable release of PyMEDB-Core is hosted at +`PyEDB-Core documentation `_. +The documentation has five sections: + +- `Getting started `_: Describes + how to install PyEDB-Core in user mode. +- `User guide `_: Describes how to + use PyEDB-Core. +- `API reference `_: Provides API member descriptions + and usage examples. +- `Examples `_: Provides examples showing +- end-to-end workflows for using PyEDB-Core. +- `Contribute `_: Describes how to install + PyEDB-Core in developer mode and how to contribute to this PyAnsys library. + +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. + +On the `PyEDB-Core Issues `_ page, you can create +issues to report bugs and request new features. When possible, use these issue templates: + +* Bug report template +* Feature request template +* Documentation issue template +* Example request template + +If your issue does not fit into one of these categories, create your own issue. + +On the `Discussions `_ page on the Ansys Developer portal, you can post questions, +share ideas, and get community feedback. + +To reach the PyAnsys support team, email `pyansys.core@ansys.com `_. + +License +~~~~~~~ +PyEDB-Core is licensed under the MIT license. + +PyEDB-Core makes no commercial claim over Ansys whatsoever. The use of this Python client requires +a legally licensed copy of AEDT. For more information, see the +`Ansys Electronics `_ page on the Ansys website. diff --git a/doc/source/404.rst b/doc/source/404.rst deleted file mode 100644 index a8683cc4e2..0000000000 --- a/doc/source/404.rst +++ /dev/null @@ -1,10 +0,0 @@ -:orphan: - -Oops! -===== - - -This is unexpected. - - -The page you are requesting does not exist. \ No newline at end of file diff --git a/doc/source/_static/README.md b/doc/source/_static/README.md index ff7796e464..d2c955ccc3 100644 --- a/doc/source/_static/README.md +++ b/doc/source/_static/README.md @@ -1 +1 @@ -Static files will be found here (like images and other assets). +Static files are found here (like images and other assets). diff --git a/doc/source/api/hierarchy.rst b/doc/source/api/hierarchy.rst index 4f818129c1..12c089980f 100644 --- a/doc/source/api/hierarchy.rst +++ b/doc/source/api/hierarchy.rst @@ -5,7 +5,7 @@ Hierarchy objects are :term:`Connectables ` that can act as a conta Sub-designs, MCAD Components, Coordinate systems etc.. are all examples of hierarchy objects. -Object Types +Object types ------------ .. currentmodule:: ansys.edb.core.hierarchy diff --git a/doc/source/api/index.rst b/doc/source/api/index.rst index 783daabb70..fc2bd44501 100644 --- a/doc/source/api/index.rst +++ b/doc/source/api/index.rst @@ -1,14 +1,10 @@ .. _ref_index_api: ============= -API Reference +API reference ============= -**[Ansys Internal - Confidential]** -**This is a working document and will be changed without notice.** - - -This section gives an overview of the API for all the classes, functions, and attributes. +This section describes all API classes, functions, and attributes in PyEDB-Core modules. ******* Modules diff --git a/doc/source/api/layout_instance.rst b/doc/source/api/layout_instance.rst index d548663062..6ac62de17e 100644 --- a/doc/source/api/layout_instance.rst +++ b/doc/source/api/layout_instance.rst @@ -1,4 +1,4 @@ -Layout Instance +Layout instance =============== Classes diff --git a/doc/source/api/release_notes.rst b/doc/source/api/release_notes.rst index 2fafe5e857..1b406b6680 100644 --- a/doc/source/api/release_notes.rst +++ b/doc/source/api/release_notes.rst @@ -1,9 +1,10 @@ -Release Notes +Release notes ============= v1.0 ---- -Known Issues: - * If a new database is opened after another one is closed, the server may fail to properly fetch objects that are created after the new database is opened. - * See `issue #154 `_ \ No newline at end of file +Known issues: + +* If a new database is opened after another one is closed, the server may fail to properly fetch objects that are created after the new database is opened. + See `issue #154 `_. diff --git a/doc/source/api/session.rst b/doc/source/api/session.rst index 1ac95cb9d9..91f74c270c 100644 --- a/doc/source/api/session.rst +++ b/doc/source/api/session.rst @@ -1,8 +1,8 @@ Session ======= -A session both launches a new server executable and creates a channel connection to that server. Once that -occurs, all EDB API function calls will be processed using that channel. +A session both launches a new EDB API server and creates a channel connection to this server. +Once these actions are completed, all EDB API function calls are processed using this channel. Functions --------- diff --git a/doc/source/api/simulation_setup.rst b/doc/source/api/simulation_setup.rst index 2c508bb8d3..8747eda159 100644 --- a/doc/source/api/simulation_setup.rst +++ b/doc/source/api/simulation_setup.rst @@ -1,4 +1,4 @@ -Simulation Setup +Simulation setup ================ Classes diff --git a/doc/source/conf.py b/doc/source/conf.py index 080a2b9770..16df96555e 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -8,7 +8,7 @@ from ansys.edb.core import __version__ # Project information -project = "ansys-edb" +project = "ansys-edb-core" copyright = f"(c) {datetime.now().year} ANSYS, Inc. All rights reserved" author = "ANSYS, Inc." release = version = __version__ @@ -17,11 +17,11 @@ # use the default pyansys logo html_logo = pyansys_logo_black html_theme = "ansys_sphinx_theme" -html_short_title = html_title = "PyEDB" +html_short_title = html_title = "PyEDB-Core" html_context = { "github_user": "ansys", - "github_repo": "pyedb", + "github_repo": "pyedb-core", "github_version": "develop", "doc_path": "doc/source", } @@ -32,7 +32,7 @@ "version_match": get_version_match(__version__), }, "check_switcher": False, - "github_url": "https://github.com/ansys/pyedb", + "github_url": "https://github.com/ansys/pyedb-core", "show_prev_next": False, "show_breadcrumbs": True, "collapse_navigation": True, diff --git a/doc/source/contribute.rst b/doc/source/contribute.rst new file mode 100644 index 0000000000..39556c4a8a --- /dev/null +++ b/doc/source/contribute.rst @@ -0,0 +1,181 @@ +.. _contribute_pyedb: + +Contribute +========== + +Overall guidance on contributing to a PyAnsys library appears in the +`Contributing `_ topic in the *PyAnsys developer's guide*. +Ensure that you are thoroughly familiar with this guide before attempting to contribute +to PyEDB-Core. + +The following contribution information is specific to PyEDB-Core. + +.. _dev_install: + +Developer installation +---------------------- +Installing the ``ansys-edb`` package in developer mode allows you to modify the source and +enhance it. + +This package supports Python 3.9 through 3.12 on Windows, Linux, and MacOS. + +#. Clone the repository: + + .. code:: bash + + git clone https://github.com/ansys/pyedb-core + cd pyedb + +#. Create a fresh-clean Python `virtual environment `_ and activate it: + + .. code:: bash + + # Create a virtual environment + python -m venv .venv + + # Activate it in a Linux environment + python -m venv .venv && source .venv/bin/activate + + # Activate it in a Windows CMD environment + .venv\Scripts\activate.bat + + # Activate it in a Windows Powershell environment + .venv\Scripts\Activate.ps1 + +#. Make sure you have the latest required build system and documentation, testing, and CI tools: + + .. code:: bash + + python -m pip install -U pip tox + + # Copy default environment variables for test + cp .env.test.example .env.test + + # Modify .env.test if necessary + +#. Verify your development installation: + + .. code:: bash + + tox + +Testing +------- + +This project takes advantage of `tox`_. Similar to Makefile, this tool allows you to automate +common tasks, but it is oriented towards Python development. + +Using ``tox`` +^^^^^^^^^^^^^ + +While Makefile has rules, `tox` has environments. In fact, the tool creates its +own virtual environment so anything being tested is isolated from the project +to guarantee the project's integrity. The following environments commands are provided: + +- **tox -e style**: Checks for coding style quality. +- **tox -e test**: Checks for unit tests. Pass `pytest `_ flags after the + ``--`` portion of the command. For example, use this ``pytest`` command to show the + standard output, replacing ``X`` with the minor version of your Python environment: + ``tox -e py3X -- -s``. +- **tox -e coverage**: Checks for code coverage. +- **tox -e doc**: Checks for documentation building. + +Raw testing +^^^^^^^^^^^ + +If required, you can always call code style tools, such as `black`_, `isort`_, +and `flake8`_, or unit testing tools, such as `pytest`_ from the command line. +However, using these tools do not guarantee that your project is being tested in an isolated +environment, which is the reason why a tool like `tox`_ exists. + +Adhere to code style +-------------------- +PyEDB-Core follows the PEP8 standard as indicated in `PEP 8 `_ +in the *PyAnsys developer's guide*. It also implements style checking using `pre-commit `_. + +To ensure your code meets minimum code styling standards, run these commands: + +.. code:: console + + pip install pre-commit + pre-commit run --all-files + +You can also install this as a pre-commit hook by running this command: + +.. code:: console + + pre-commit install + +This way, it's not possible for you to push code that fails the code style checks: + +.. code:: text + + $ git commit -am "added my cool feature" + black....................................................................Passed + blacken-docs.............................................................Passed + isort....................................................................Passed + flake8...................................................................Passed + docformatter.............................................................Passed + codespell................................................................Passed + check for merge conflicts................................................Passed + debug statements (python)................................................Passed + check yaml...............................................................Passed + trim trailing whitespace.................................................Passed + Add License Headers......................................................Passed + Validate GitHub Workflows................................................Passed + +Documentation +------------- + +To install the required dependencies for the documentation, run this command: + +.. code:: + + pip install .[doc] + + +To build the documentation, run the usual rules provided in the `Sphinx `_ +Makefile for your operating system. + +**On Windows:** + +.. code:: + + .\doc\make.bat html + .\doc\build\html\index.html + +**On Linux and MacOS:** + +.. code:: + + make -C doc/ html && your_browser_name doc/build/html/index.html + +However, the recommended way of checking documentation integrity is to use ``tox``: + +.. code:: bash + + tox -e doc && your_browser_name .tox/doc_out/html/index.html + +Distributing +------------ + +If you would like to create either source or wheel files, run these commands: + +.. code:: bash + + flit build + python -m twine check dist/* + +.. LINKS AND REFERENCES +.. _dev_guide_contributing: https://dev.docs.pyansys.com/how-to/contributing.html +.. _pyedb_repo: https://github.com/ansys/pyedb-core +.. _venv: https://docs.python.org/3/library/venv.html +.. _tox: https://tox.wiki/ +.. _Sphinx: https://www.sphinx-doc.org/en/master/ +.. _dynalib_repo_issues: https://github.com/ansys/pyedb-core/issues +.. _pytest: https://docs.pytest.org/en/stable/ +.. _black: https://black.readthedocs.io/en/latest/ +.. _isort: https://pycqa.github.io/isort/ +.. _flake8: https://flake8.pycqa.org/en/latest/ +.. _dev_guide_pyansys_pep8: https://dev.docs.pyansys.com/coding-style/pep8.html +.. _pre-commit: https://pre-commit.com/ diff --git a/doc/source/examples/examples.rst b/doc/source/examples/examples.rst deleted file mode 100644 index 0978cc2437..0000000000 --- a/doc/source/examples/examples.rst +++ /dev/null @@ -1,9 +0,0 @@ -Examples -======== - -**[Ansys Internal - Confidential]** - - -Examples documentation goes here. - - diff --git a/doc/source/examples/index.rst b/doc/source/examples/index.rst new file mode 100644 index 0000000000..50ef361d92 --- /dev/null +++ b/doc/source/examples/index.rst @@ -0,0 +1,52 @@ +Examples +======== + +Examples in the form of Jupyter notebooks demonstrate API usage. +To run these notebooks, perform these steps: + +#. Create and activate a Python `virtual environment `_: + + .. code:: bash + + python -m venv .venv + .venv\Scripts\activate.bat + + For more information on creating and installing a virtual environment, see + :ref:`dev_install`. + +#. Ensure that you have the latest version of `pip`_: + + .. code:: bash + + python -m pip install -U pip + +#. Build and install the ``ansys-edb`` and ``ansys-api`` packages: + + .. code:: bash + + python -m pip install -e . + +#. Install Jupyter notebook requirements: + + .. code:: bash + + python -m pip install .[notebook] + +#. Install the IPython kernel: + + .. code:: bash + + ipython kernel install --user --name=.venv + +#. Launch Juptyer notebook: + + .. code:: bash + + jupyter-notebook + +6. Navigate to desired notebook example, change the kernel to the virtual environment, and execute the notebook + with the desired settings. + +.. LINKS AND REFERENCES +.. _venv: https://docs.python.org/3/library/venv.html +.. _pip: https://pypi.org/project/pip/ diff --git a/doc/source/getting_started/index.rst b/doc/source/getting_started/index.rst new file mode 100644 index 0000000000..8b2ef02ef8 --- /dev/null +++ b/doc/source/getting_started/index.rst @@ -0,0 +1,27 @@ +Getting started +=============== + +To run PyEDB-Core, you must have a licensed copy of AEDT installed. + +PyEDB-Core has two installation modes: user and developer. The following instructions +assume that you want to install PyEDB-Core in user mode. If you want to contribute to the +development of PyEDB-Core, you must install it in developer mode. For more information, see +:ref:`contribute_pyedb`. + +Installation +------------ + +#. To ensure that you have the latest version of `pip`_, run this command: + + .. code:: bash + + python -m pip install -U pip + +#. To install PyEDB-Core, run this command: + + .. code:: bash + + python -m pip install ansys-edb + +.. LINKS AND REFERENCES +.. _pip: https://pypi.org/project/pip/ \ No newline at end of file diff --git a/doc/source/index.rst b/doc/source/index.rst index 65dd59601e..b8c94e8ff3 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -1,24 +1,23 @@ -pyedb Documentation -=================== +PyEDB-Core documentation |version| +================================== -**[Ansys Internal - Confidential]** - - -**This is a working document and will be changed without notice.** - -The Electronics Database (EDB) is a format for storing information describing designs for the Ansys Electronic Desktop (AEDT). This Python API makes calls to an EDB Server that can be run locally or remotely. - -Currently the server can create, edit, read and write EDB file to disk. After that, it can be read into AEDT and simulated. - -Choose :ref:`ref_index_api` to access a complete description of all the available Python classes and functions. +.. + Simply reuse the root readme +.. include:: ../../README.rst + :start-after: .. reuse_start .. toctree:: :hidden: - installation - user_guide/user_guide + getting_started/index + user_guide/index api/index - examples/examples + examples/index + contribute +Indices and tables +================== +* :ref:`genindex` +* :ref:`search` diff --git a/doc/source/installation.rst b/doc/source/installation.rst deleted file mode 100644 index 30c2c1cc60..0000000000 --- a/doc/source/installation.rst +++ /dev/null @@ -1,9 +0,0 @@ -Installation -============ - -**[Ansys Internal - Confidential]** - - -.. include:: ../../README.rst - - diff --git a/doc/source/user_guide/index.rst b/doc/source/user_guide/index.rst new file mode 100644 index 0000000000..e7a7250330 --- /dev/null +++ b/doc/source/user_guide/index.rst @@ -0,0 +1,9 @@ +User guide +========== + +PyEDB-Core provides an API for accessing and manipulating designs in the EBD format. +Design types managing layout data in AEDT have a corresponding ``aedb`` directory alongside +the AEDT file. The ``aedb`` directory contains the EDB database. + +Additionally, EDB databases can be created by Ansys translators or by using the PyEDB-Core +API directly. You can then import the resulting EDB into AEDT. diff --git a/doc/source/user_guide/user_guide.rst b/doc/source/user_guide/user_guide.rst deleted file mode 100644 index c4d7e9915b..0000000000 --- a/doc/source/user_guide/user_guide.rst +++ /dev/null @@ -1,8 +0,0 @@ -User Guide -========== - -**[Ansys Internal - Confidential]** - -The classes and functions are in the **ansys.edb** package. - -The Electronics Database (EDB) API allows access and manipulation of EDB databases. Design types managing Layout data in Ansys Electronics Desktop have a corresponding aedb directory alongside the AEDT file -- the aedb directory contains the EDB database. EDB databases can also be created by Ansys translators, or by using these API functions directly; the resulting EDB can then be imported into Ansys Electronics Desktop diff --git a/doc/styles/Vocab/ANSYS/accept.txt b/doc/styles/Vocab/ANSYS/accept.txt index 8c836a96d1..3f94bc337b 100644 --- a/doc/styles/Vocab/ANSYS/accept.txt +++ b/doc/styles/Vocab/ANSYS/accept.txt @@ -3,4 +3,10 @@ Enums PyAnsys PyEDB pyedb +PyEDB-Core EDB +IPython +isort +Juptyer +Makefile +pytest diff --git a/src/ansys/edb/core/__init__.py b/src/ansys/edb/core/__init__.py index b02d9f3ae1..58252a2f38 100644 --- a/src/ansys/edb/core/__init__.py +++ b/src/ansys/edb/core/__init__.py @@ -1,4 +1,4 @@ -"""Ansys Electronics Database Python Package.""" +"""EDB-Core Python package for the Electronics Database (EDB) format.""" try: import importlib.metadata as importlib_metadata diff --git a/src/ansys/edb/core/database.py b/src/ansys/edb/core/database.py index 4e71b7e954..b9f9cd9808 100644 --- a/src/ansys/edb/core/database.py +++ b/src/ansys/edb/core/database.py @@ -34,10 +34,10 @@ class ProductIdType(Enum): - """Enum representing the ids of Ansys products that support EDB usage. + """Provides an enum representing IDs of Ansys products that support EDB usage. - HFSS_3D_LAYOUT - - DESIGNER (deprecated. use HFSS_3D_LAYOUT instead) + - DESIGNER (Deprecated. Use HFSS_3D_LAYOUT instead.) - SIWAVE - GENERIC_TRANSLATOR - USER_DEFINED @@ -51,12 +51,12 @@ class ProductIdType(Enum): class Database(ObjBase, variable_server.VariableServer): - """Class representing a database object.""" + """Represents a database object.""" __stub: DatabaseServiceStub = StubAccessor(StubType.database) def __init__(self, msg): - """Initialize a new Database. + """Initialize a new database. Parameters ---------- @@ -67,12 +67,12 @@ def __init__(self, msg): @classmethod def create(cls, db_path): - """Create a Database at the specified file location. + """Create a database at the specified file location. Parameters ---------- db_path : str - Path to top-level database folder + Path to the top-level database folder. Returns ------- @@ -84,19 +84,19 @@ def create(cls, db_path): @classmethod def open(cls, db_path, read_only): - """Open an existing Database at the specified file location. + """Open an existing database at the specified file location. Parameters ---------- db_path : str - Path to top-level Database folder. + Path to the top-level database folder. read_only : bool - Obtain read-only access. + Whether to open the database in read-only mode. Returns ------- - Database or None - The opened Database object, or None if not found. + Database object or None + Opened database object or ``None`` if no database object is found. """ return Database( cls.__stub.Open( @@ -114,31 +114,31 @@ def delete(cls, db_path): Parameters ---------- db_path : str - Path to top-level database folder. + Path to the top-level database folder. """ cls.__stub.Delete(proto_wrappers.StringValue(value=db_path)) def save(self): - """Save any changes into a file.""" + """Save any changes to a file.""" self.__stub.Save(self.msg) def close(self): """Close the database. .. note:: - Unsaved changes will be lost. + Unsaved changes are lost. """ self.__stub.Close(self.msg) self.msg = None @staticmethod def _map_cell_edb_obj_collection(cells_msg): - """Get a list of cell objects from the EDBObjCollection msg.""" + """Get a list of cell objects from the ``EDBObjCollection`` message.""" return map_list(cells_msg.items, Cell) @property def top_circuit_cells(self): - """Get top circuit cells. + """Top circuit cells in the database. Returns ------- @@ -148,7 +148,7 @@ def top_circuit_cells(self): @property def circuit_cells(self): - """Get all circuit cells in the Database. + """All circuit cells in the database. Returns ------- @@ -158,7 +158,7 @@ def circuit_cells(self): @property def footprint_cells(self): - """Get all footprint cells in the Database. + """All footprint cells in the database. Returns ------- @@ -168,23 +168,23 @@ def footprint_cells(self): @property def edb_uid(self): - """Get ID of the database. + """Unique EDB ID of the database. Returns ------- int - The unique EDB id of the Database. + Unique EDB ID of the database. """ return self.__stub.GetId(self.msg).value @property def is_read_only(self): - """Determine if the database is open in a read-only mode. + """Flag indicating if the database is open in read-only mode. Returns ------- bool - True if Database is open with read only access, otherwise False. + ``True`` when the database is open in read-only mode, ``False`` otherwise. """ return self.__stub.IsReadOnly(self.msg).value @@ -195,24 +195,25 @@ def find_by_id(cls, db_id): Parameters ---------- db_id : int - The Database's unique EDB id. + Unique EDB ID for the database. Returns ------- Database - The Database or Null on failure + Database when successful, Null when failed. """ return Database(cls.__stub.FindById(proto_wrappers.Int64Value(value=db_id))) def save_as(self, path, version=""): - """Save this Database to a new location and older EDB version. + """Save the database to a new location and older EDB version. Parameters ---------- path : str - New Database file location. - version : str - EDB version to save to. Empty string means current version. + Location for saving the new database file to. + version : str, optional + EDB version for the new database file. The default is ``""``, which means that + the new database file is saved for the current version. """ self.__stub.SaveAs( database_pb2.SaveAsDatabaseMessage(db=self.msg, new_location=path, version=version) @@ -220,7 +221,7 @@ def save_as(self, path, version=""): @classmethod def get_version_by_release(cls, release): - """Get the EDB version corresponding to the given release name. + """Get the EDB version corresponding to a given release name. Parameters ---------- @@ -236,7 +237,7 @@ def get_version_by_release(cls, release): @property def directory(self): - """Get the directory of the Database. + """Directory of the database. Returns ------- @@ -258,14 +259,14 @@ def get_product_property(self, prod_id, attr_it): Returns ------- str - Property value returned. + Property value. """ return self.__stub.GetProductProperty( get_product_property_message(self, prod_id, attr_it) ).value def set_product_property(self, prod_id, attr_it, prop_value): - """Set the product property associated with the given product and attribute ids. + """Set the product property associated with the given product and attribute IDs. Parameters ---------- @@ -274,14 +275,14 @@ def set_product_property(self, prod_id, attr_it, prop_value): attr_it : int Attribute ID. prop_value : str - Product property's new value + New value for the product property. """ self.__stub.SetProductProperty( set_product_property_message(self, prod_id, attr_it, prop_value) ) def get_product_property_ids(self, prod_id): - """Get a list of attribute ids corresponding to a product property id. + """Get a list of attribute IDs corresponding to a product property ID. Parameters ---------- @@ -291,7 +292,7 @@ def get_product_property_ids(self, prod_id): Returns ------- list[int] - The attribute ids associated with this product property. + Attribute IDs associated with the product property. """ attr_ids = self.__stub.GetProductPropertyIds( get_product_property_ids_message(self, prod_id) @@ -299,16 +300,17 @@ def get_product_property_ids(self, prod_id): return [attr_id for attr_id in attr_ids] def import_material_from_control_file(self, control_file, schema_dir=None, append=True): - """Import materials from the provided control file. + """Import materials from a control file. Parameters ---------- control_file : str - Control file name with full path. + Full path to the control file. schema_dir : str - Schema file path. - append : bool - True if the existing materials in Database are kept. False to remove existing materials in database. + Path to the schema directory. + append : bool, optional + Whether to keep existing materials in the database. The default is ``True``. If + ``False``, the existing materials in the database are removed. """ self.__stub.ImportMaterialFromControlFile( database_pb2.ImportMaterialFromControlFileMessage( @@ -321,47 +323,46 @@ def import_material_from_control_file(self, control_file, schema_dir=None, appen @property def version(self): - """Get version of the Database. + """Version of the database. Returns ------- tuple(int, int) - A tuple of the version numbers [major, minor] + Tuple of the version numbers [major, minor]. """ version_msg = self.__stub.GetVersion(self.msg) return version_msg.major.id, version_msg.minor.id def scale(self, scale_factor): - """Uniformly scale all geometry and their locations by a positive factor. + """Scale all geometries and their locations uniformly by a positive factor. Parameters ---------- scale_factor : float - Amount that coordinates are multiplied by. + Amount to multiply coordinates by. """ self.__stub.Scale(double_property_message(self, scale_factor)) @property def source(self): - """Get source name for this Database. + """Source name for this database. This attribute is also used to set the source name. Returns ------- str - name of the source + Name of the source """ return self.__stub.GetSource(self.msg).value @source.setter def source(self, source): - """Set source name of the database.""" self.__stub.SetSource(edb_obj_name_message(self, source)) @property def source_version(self): - """Get the source version for this Database. + """Source version for this database. This attribute is also used to set the version. @@ -375,11 +376,10 @@ def source_version(self): @source_version.setter def source_version(self, source_version): - """Set source version of the database.""" self.__stub.SetSourceVersion(edb_obj_name_message(self, source_version)) def copy_cells(self, cells_to_copy): - """Copy Cells from other Databases or this Database into this Database. + """Copy Cells from other databases or this database into this database. Parameters ---------- @@ -389,7 +389,7 @@ def copy_cells(self, cells_to_copy): Returns ------- list[:class:`Cell `] - New Cells created in this Database. + New cells created in this database. """ return Database._map_cell_edb_obj_collection( self.__stub.CopyCells( @@ -400,7 +400,7 @@ def copy_cells(self, cells_to_copy): ) def _get_definition_objs(self, def_class, def_type_enum, bw_def_type_enum=None): - """Get the definition objects of the given type.""" + """Get the definition objects of a given type.""" def_objs = self.__stub.GetDefinitionObjs( database_pb2.GetDefinitionObjsMessage( target=self.msg, @@ -411,14 +411,14 @@ def _get_definition_objs(self, def_class, def_type_enum, bw_def_type_enum=None): return map_list(def_objs.items, def_class) def _get_bondwire_definition_objs(self, def_class, bw_def_type_enum): - """Get the bondwire definition objects of the given type.""" + """Get the bondwire definition objects of a given type.""" return self._get_definition_objs( def_class, DefinitionObjType.BONDWIRE_DEF, bw_def_type_enum ) @property def apd_bondwire_defs(self): - """Get all APD bondwire definitions in this Database. + """All APD bondwire definitions in the database. Returns ------- @@ -428,7 +428,7 @@ def apd_bondwire_defs(self): @property def jedec4_bondwire_defs(self): - """Get all JEDEC4 bondwire definitions in this Database. + """All JEDEC4 bondwire definitions in the database. Returns ------- @@ -440,7 +440,7 @@ def jedec4_bondwire_defs(self): @property def jedec5_bondwire_defs(self): - """Get all JEDEC5 bondwire definitions in this Database. + """All JEDEC5 bondwire definitions in the database. Returns ------- @@ -452,7 +452,7 @@ def jedec5_bondwire_defs(self): @property def padstack_defs(self): - """Get all Padstack definitions in this Database. + """All padstack definitions in the database. Returns ------- @@ -462,7 +462,7 @@ def padstack_defs(self): @property def package_defs(self): - """Get all Package definitions in this Database. + """All package definitions in the database. Returns ------- @@ -472,7 +472,7 @@ def package_defs(self): @property def component_defs(self): - """Get all component definitions in the database. + """All component definitions in the database. Returns ------- @@ -482,7 +482,7 @@ def component_defs(self): @property def material_defs(self): - """Get all material definitions in the database. + """All material definitions in the database. Returns ------- @@ -492,7 +492,7 @@ def material_defs(self): @property def dataset_defs(self): - """Get all dataset definitions in the database. + """All dataset definitions in the database. Returns ------- diff --git a/src/ansys/edb/core/definition/bondwire_def.py b/src/ansys/edb/core/definition/bondwire_def.py index 53a17af9c9..1941563227 100644 --- a/src/ansys/edb/core/definition/bondwire_def.py +++ b/src/ansys/edb/core/definition/bondwire_def.py @@ -1,4 +1,4 @@ -"""Bondwire Definition.""" +"""Bondwire definition.""" from enum import Enum @@ -45,7 +45,7 @@ def bondwire_def_str_message(obj, string): class BondwireDefType(Enum): - """Enum representing bondwire types. + """Provides an enum representing bondwire types. - APD_BONDWIRE_DEF APD bondwire. @@ -61,7 +61,7 @@ class BondwireDefType(Enum): class BondwireDef(ObjBase): - """Class representing a bondwire definition.""" + """Represents a bondwire definition.""" __stub: bondwire_def_pb2_grpc.BondwireDefServiceStub = StubAccessor(StubType.bondwire_def) @@ -84,7 +84,7 @@ def delete(self): class ApdBondwireDef(BondwireDef): - """Class representing an apd bondwire definition.""" + """Represents an APD bondwire definition.""" __stub: bondwire_def_pb2_grpc.ApdBondwireDefServiceStub = StubAccessor( StubType.apd_bondwire_def @@ -92,58 +92,58 @@ class ApdBondwireDef(BondwireDef): @classmethod def create(cls, database, name): - """Create an apd bondwire definition. + """Create an APD bondwire definition. Parameters ---------- database : :class:`Database `. - Database in which Apd Bondwire definition will be searched. + Database to create the APD bondwire definition in. name : str - Name of the Apd Bondwire definition. + Name of the APD bondwire definition. Returns ------- ApdBondwireDef - Apd Bondwire definition created. + APD bondwire definition created. """ bw_msg = cls.__stub.Create(_QueryBuilder.bondwire_def_str_message(database, name)) return ApdBondwireDef(bw_msg) @classmethod def load_definitions_from_file(cls, database, name): - """Load APD bondwire definition into the given database. + """Load an APD bondwire definition into the given database. Parameters ---------- database : :class:`Database ` - Database in which Apd Bondwire definition will be load. + Database to load the APD bondwire to. name : str - Name of the Apd Bondwire definition. + Name of the APD bondwire definition. """ cls.__stub.LoadDefinitionsFromFile(_QueryBuilder.bondwire_def_str_message(database, name)) @classmethod def find_by_name(cls, database, name): - """Find an apd bondwire definition by name into the given database. + """Find an APD bondwire definition by name in the given database. Parameters ---------- database : :class:`Database ` - Database in which Apd Bondwire definition will be searched. + Database to search for the APD bondwire definition. name : str - Name of the Apd Bondwire definition. + Name of the APD bondwire definition. Returns ------- ApdBondwireDef - Apd Bondwire definition found. + APD bondwire definition found. """ return ApdBondwireDef( cls.__stub.FindByName(_QueryBuilder.bondwire_def_str_message(database, name)) ) def get_parameters(self): - """Get parameters of an apd bondwire definition. + """Get parameters of an APD bondwire definition. Returns ------- @@ -153,7 +153,7 @@ def get_parameters(self): return self.__stub.GetParameters(self.msg) def set_parameters(self, name): - """Set parameters of an apd bondwire definition. + """Set parameters of an APD bondwire definition. Parameters ---------- @@ -164,9 +164,9 @@ def set_parameters(self, name): @property def bondwire_type(self): - """:class:`BondwireDefType`: Type of the apd bondwire definition. + """:class:`BondwireDefType`: Type of the APD bondwire definition. - Read-Only. + This attribute is read-only. """ return BondwireDefType.APD_BONDWIRE_DEF @@ -181,7 +181,7 @@ def jedec4_bondwire_def_set_parameters_message(j, top_to_die_distance): class Jedec4BondwireDef(BondwireDef): - """Class representing a jedec 4 bondwire definition.""" + """Represents a JEDEC4 bondwire definition.""" __stub: bondwire_def_pb2_grpc.Jedec4BondwireDefServiceStub = StubAccessor( StubType.jedec4_bondwire_def @@ -189,19 +189,19 @@ class Jedec4BondwireDef(BondwireDef): @classmethod def create(cls, database, name): - """Create a jedec 4 bondwire definition. + """Create a JEDEC4 bondwire definition. Parameters ---------- database : :class:`Database ` - Database in which Jedec4 Bondwire definition will be created. + Database to create the JEDEC4 bondwire definition in. name : str - Name of the Jedec4 Bondwire definition. + Name of the JEDEC4 bondwire definition. Returns ------- Jedec4BondwireDef - Jedec4 Bondwire definition created. + JEDEC4 bondwire definition created. """ return Jedec4BondwireDef( cls.__stub.Create(_QueryBuilder.bondwire_def_str_message(database, name)) @@ -209,41 +209,41 @@ def create(cls, database, name): @classmethod def find_by_name(cls, database, name): - """Find a jedec 4 bondwire definition by name. + """Find a JEDEC4 bondwire definition by name. Parameters ---------- database : :class:`Database ` - Database in which Jedec4 Bondwire definition will be searched. + Database to search for the JEDEC4 bondwire definition. name : str - Name of the Jedec4 Bondwire definition. + Name of the JEDEC4 bondwire definition. Returns ------- Jedec4BondwireDef - Jedec4 Bondwire definition found. + JEDEC4 bondwire definition found. """ return Jedec4BondwireDef( cls.__stub.FindByName(_QueryBuilder.bondwire_def_str_message(database, name)) ) def get_parameters(self): - """Get parameters of a jedec 4 bondwire definition. + """Get parameters of a JEDEC4 bondwire definition. Returns ------- :class:`Value ` - Bondwire top to die distance. + Bondwire top-to-die distance. """ return Value(self.__stub.GetParameters(self.msg)) def set_parameters(self, top_to_die_distance): - """Set parameters of a jedec 4 bondwire definition. + """Set parameters of a JEDEC4 bondwire definition. Parameters ---------- top_to_die_distance : :class:`Value ` - Bondwire top to die distance. + Bondwire top-to-die distance. """ self.__stub.SetParameters( _Jedec4QueryBuilder.jedec4_bondwire_def_set_parameters_message( @@ -253,9 +253,9 @@ def set_parameters(self, top_to_die_distance): @property def bondwire_type(self): - """:class:`BondwireDefType`: Type of the jedec 4 bondwire definition. + """:class:`BondwireDefType`: Type of the JEDEC4 bondwire definition. - Read-Only. + This attribute is read-only. """ return BondwireDefType.JEDEC4_BONDWIRE_DEF @@ -285,7 +285,7 @@ def jedec5_bondwire_def_set_parameters_message( class Jedec5BondwireDef(BondwireDef): - """Class representing a jedec 5 bondwire definition.""" + """Represents a JEDEC5 bondwire definition.""" __stub: bondwire_def_pb2_grpc.Jedec5BondwireDefServiceStub = StubAccessor( StubType.jedec5_bondwire_def @@ -293,14 +293,14 @@ class Jedec5BondwireDef(BondwireDef): @classmethod def create(cls, database, name): - """Create a jedec 5 bondwire definition. + """Create a JEDEC5 bondwire definition. Parameters ---------- database : :class:`Database ` - Database in which Jedec5 Bondwire definition will be created. + Database to create the JEDEC5 bondwire definition in. name : str - Name of the Jedec5 Bondwire definition. + Name of the JEDEC5 bondwire definition. Returns ------- @@ -313,26 +313,26 @@ def create(cls, database, name): @classmethod def find_by_name(cls, database, name): - """Find a jedec 5 bondwire definition by name. + """Find a JEDEC5 bondwire definition by name. Parameters ---------- database : :class:`Database ` - Database in which Jedec5 Bondwire definition will be searched. + Database to search for the JEDEC5 bondwire definition. name : str - Name of the Jedec5 Bondwire definition. + Name of the JEDEC5 bondwire definition. Returns ------- Jedec5BondwireDef - Jedec5 Bondwire definition found. + JEDEC5 bondwire definition found. """ return Jedec5BondwireDef( cls.__stub.FindByName(_QueryBuilder.bondwire_def_str_message(database, name)) ) def get_parameters(self): - """Get parameters of a jedec 5 bondwire definition. + """Get parameters of a JEDEC5 bondwire definition. Returns ------- @@ -360,12 +360,12 @@ def get_parameters(self): ) def set_parameters(self, top_to_die_distance, die_pad_angle, lead_pad_angle): - """Set parameters of a jedec 5 bondwire definition. + """Set parameters of a JEDEC5 bondwire definition. Parameters ---------- top_to_die_distance : :class:`Value ` - Bondwire top to die distance. + Bondwire top-to-die distance. die_pad_angle : :class:`Value ` Bondwire die pad angle. lead_pad_angle : :class:`Value ` @@ -379,8 +379,8 @@ def set_parameters(self, top_to_die_distance, die_pad_angle, lead_pad_angle): @property def bondwire_type(self): - """:class:`BondwireDefType`: Type of the jedec 5 bondwire definition. + """:class:`BondwireDefType`: Type of the JEDEC5 bondwire definition. - Read-Only. + This attribute is read-only. """ return BondwireDefType.JEDEC5_BONDWIRE_DEF diff --git a/src/ansys/edb/core/definition/component_def.py b/src/ansys/edb/core/definition/component_def.py index ac5febe955..371dcaaeda 100644 --- a/src/ansys/edb/core/definition/component_def.py +++ b/src/ansys/edb/core/definition/component_def.py @@ -1,4 +1,4 @@ -"""Component Def Definition.""" +"""Component definition.""" from ansys.api.edb.v1.component_def_pb2_grpc import ComponentDefServiceStub from ansys.edb.core.definition import component_model, component_pin @@ -10,7 +10,7 @@ class ComponentDef(ObjBase): - """Class representing a Component Definition.""" + """Represents a component definition.""" __stub: ComponentDefServiceStub = StubAccessor(StubType.component_def) @@ -21,16 +21,16 @@ def create(cls, db, comp_def_name, fp): Parameters ---------- db : :class:`Database ` - Database that the component definition should belong to. + Database to create the component definition in. comp_def_name : str - Name of the component definition to be created. + Name of the component definition to create. fp : :class:`Cell ` Footprint cell of the component definition. Returns ------- ComponentDef - Newly created component definition. + Component definition created. """ return ComponentDef( cls.__stub.Create(messages.component_def_creation_message(db, comp_def_name, fp)) @@ -43,14 +43,14 @@ def find(cls, db, comp_def_name): Parameters ---------- db : :class:`Database ` - Database to search the component definition in. + Database to search for the component definition. comp_def_name : str - Name of the component definition to be searched. + Name of the component definition. Returns ------- ComponentDef - Component definition that was found, None otherwise. + Component definition that was found or ``None`` otherwise. """ return ComponentDef( cls.__stub.FindByName(messages.object_name_in_layout_message(db, comp_def_name)) @@ -82,7 +82,7 @@ def footprint(self, value): @property def component_models(self): """:obj:`list` of :class:`ComponentModel `: \ - List of component models associated with this component definition. + List of component models associated with the component definition. Read-Only. """ @@ -92,9 +92,9 @@ def component_models(self): @property def component_pins(self): """:obj:`list` of :class:`ComponentPin `: \ - List of component pins of this component definition. + List of component pins of the component definition. - Read-Only. + This attribute is read-only. """ objs = self.__stub.GetComponentPins(self.msg).items return map_list(objs, component_pin.ComponentPin) diff --git a/src/ansys/edb/core/definition/component_model.py b/src/ansys/edb/core/definition/component_model.py index 24c542e20d..70c24c023e 100644 --- a/src/ansys/edb/core/definition/component_model.py +++ b/src/ansys/edb/core/definition/component_model.py @@ -1,4 +1,4 @@ -"""Component Model Definition.""" +"""Component model definition.""" from ansys.api.edb.v1.component_model_pb2_grpc import ( ComponentModelServiceStub, DynamicLinkComponentModelServiceStub, @@ -11,7 +11,7 @@ class ComponentModel(ObjBase): - """Class representing a Component Model.""" + """Represents a component model.""" __stub: ComponentModelServiceStub = StubAccessor(StubType.component_model) @@ -26,40 +26,40 @@ def reference_file(self, value): class NPortComponentModel(ComponentModel): - """Class representing a NPort component model.""" + """Represents an NPort component model.""" __stub: NPortComponentModelServiceStub = StubAccessor(StubType.nport_component_model) @classmethod def create(cls, name): - """Create a NPort component model. + """Create an NPort component model. Parameters ---------- name : str - Name of the nport component model. + Name of the NPport component model. Returns ------- NPortComponentModel - Newly created nport component model. + NPort component model created. Notes ----- - The component model will not belong to a specific database until it is added to a - :class:`ComponentDef `. + The component model does not belong to a specific database until it is added to a + :class:`ComponentDef ` class. """ return NPortComponentModel(cls.__stub.Create(proto_wrappers.StringValue(value=name))) class DynamicLinkComponentModel(ComponentModel): - """Class representing a Dynamic link component model.""" + """Represents a dynamic link component model.""" __stub: DynamicLinkComponentModelServiceStub = StubAccessor(StubType.dyn_link_component_model) @classmethod def create(cls, name): - """Create a Dynamic link component model. + """Create a dynamic link component model. Parameters ---------- @@ -69,12 +69,12 @@ def create(cls, name): Returns ------- DynamicLinkComponentModel - Newly created dynamic link component model. + Dynamic link component model created. Notes ----- - The component model will not belong to a specific database until it is added to a - :class:`ComponentDef `. + The component model does not belong to a specific database until it is added to a + :class:`ComponentDef ` class. """ return DynamicLinkComponentModel(cls.__stub.Create(proto_wrappers.StringValue(value=name))) diff --git a/src/ansys/edb/core/definition/component_pin.py b/src/ansys/edb/core/definition/component_pin.py index 739fd7e336..b4f652894d 100644 --- a/src/ansys/edb/core/definition/component_pin.py +++ b/src/ansys/edb/core/definition/component_pin.py @@ -1,4 +1,4 @@ -"""Component Pin Definition.""" +"""Component pin Definition.""" from ansys.api.edb.v1.component_pin_pb2_grpc import ComponentPinServiceStub from ansys.edb.core.definition import component_def @@ -7,7 +7,7 @@ class ComponentPin(ObjBase): - """Class representing a Component Pin.""" + """Represents a component pin.""" __stub: ComponentPinServiceStub = StubAccessor(StubType.component_pin) @@ -18,14 +18,14 @@ def create(cls, comp_def, name): Parameters ---------- comp_def : :class:`ComponentDef ` - Component definition that the component pin should belong to. + Component definition that the component pin is to belong to. name : str - Name of the component pin to be created. + Name of the component pin to create. Returns ------- ComponentPin - Newly created component pin. + Component pin created. """ return ComponentPin(cls.__stub.Create(messages.edb_obj_name_message(comp_def, name))) @@ -36,14 +36,14 @@ def find(cls, comp_def, name): Parameters ---------- comp_def : :class:`ComponentDef ` - Component definition to search the component pin in. + Component definition to search for the component pin. name : str - Name of the component pin to be searched. + Name of the component pin. Returns ------- ComponentPin - Component pin that was found, None otherwise. + Component pin that was found, ``None`` otherwise. """ return ComponentPin(cls.__stub.FindByName(messages.edb_obj_name_message(comp_def, name))) @@ -60,15 +60,15 @@ def name(self, value): def number(self): """:obj:`int`: Serial number of the component pin inside its component definition. - Read-Only. + This attribute is read-only. """ return self.__stub.GetNumber(self.msg).value @property def component_def(self): - """:class:`ComponentDef `: Component definition this component pin \ - belongs to. + """:class:`ComponentDef `: Component definition that this component \ + pin belongs to. - Read-Only. + This attribute is read-only. """ return component_def.ComponentDef(self.__stub.GetComponentDef(self.msg)) diff --git a/src/ansys/edb/core/definition/component_property.py b/src/ansys/edb/core/definition/component_property.py index 67fb1941db..d477fd2548 100644 --- a/src/ansys/edb/core/definition/component_property.py +++ b/src/ansys/edb/core/definition/component_property.py @@ -1,4 +1,4 @@ -"""Component Property.""" +"""Component property.""" from ansys.api.edb.v1.component_property_pb2_grpc import ComponentPropertyServiceStub import ansys.api.edb.v1.model_pb2 as model_pb2 @@ -10,16 +10,17 @@ class ComponentProperty(ObjBase): - """Class representing a Component Property.""" + """Represents a component property.""" __stub: ComponentPropertyServiceStub = StubAccessor(StubType.component_property) def clone(self): - """Return a clone of the component property. + """Clone the component property. Returns ------- ComponentProperty + Clone of the component property. """ return ComponentProperty(self.__stub.Clone(messages.edb_obj_message(self))) @@ -27,7 +28,7 @@ def clone(self): def package_mounting_offset(self): """:class:`Value `: Offset of the package definition object. - Property can be set with :term:`ValueLike` + This attribute can be set with the :term:`ValueLike` term. """ return Value(self.__stub.GetPackageMountingOffset(messages.edb_obj_message(self))) @@ -50,7 +51,9 @@ def package_def(self, value): def model(self): """:class:`Model ` : Model object. - A copy is returned. Use the setter for any modifications to be reflected. + Returns + ------- + Copy of the model object. Use the setter for any modifications to be reflected. """ comp_model_msg = self.__stub.GetModel(messages.edb_obj_message(self)) diff --git a/src/ansys/edb/core/definition/dataset_def.py b/src/ansys/edb/core/definition/dataset_def.py index 9394379426..40d7e356af 100644 --- a/src/ansys/edb/core/definition/dataset_def.py +++ b/src/ansys/edb/core/definition/dataset_def.py @@ -1,4 +1,4 @@ -"""Dataset Def Definition.""" +"""Dataset definition.""" from ansys.api.edb.v1.dataset_def_pb2_grpc import DatasetDefServiceStub from ansys.edb.core.edb_defs import DefinitionObjType @@ -14,20 +14,20 @@ class DatasetDef(ObjBase): - """Class representing a dataset definition.""" + """Represents a dataset definition.""" __stub: DatasetDefServiceStub = StubAccessor(StubType.dataset_def) @classmethod def create(cls, database, name): - """Create a Dataset definition Object. + """Create a dataset definition object. Parameters ---------- database : :class:`Database ` - Database that the dataset definition should belong to. + Database to create the dataset definition in. name : :obj:`str` - Name of the dataset to be created. + Name of the dataset to create. Returns @@ -38,7 +38,7 @@ def create(cls, database, name): @classmethod def find_by_name(cls, database, name): - """Find a dataset definition in the database with given name. + """Find a dataset definition in the database with a given name. Parameters ---------- @@ -50,8 +50,8 @@ def find_by_name(cls, database, name): Returns ------- DatasetDef - The dataset definition object found. - If a dataset isn't found then dataset's is_null will result True. + Dataset definition object found. + If a dataset isn't found, the dataset's ``is_null`` attribute is set to ``True``. """ return DatasetDef(cls.__stub.FindByName(edb_obj_name_message(database, name))) @@ -71,7 +71,7 @@ def name(self, name): @to_point_data_list def get_data(self): - """Get a list of data points in the DatasetDef. + """Get a list of data points in the dataset definition. Returns ------- @@ -81,7 +81,7 @@ def get_data(self): return msg.points def set_data(self, points): - """Set a list of data points in the DatasetDef. + """Set a list of data points in the dataset definition. Parameters ---------- diff --git a/src/ansys/edb/core/definition/debye_model.py b/src/ansys/edb/core/definition/debye_model.py index 8805abd859..eac503bb8b 100644 --- a/src/ansys/edb/core/definition/debye_model.py +++ b/src/ansys/edb/core/definition/debye_model.py @@ -1,4 +1,4 @@ -"""Dielectric Material Definition.""" +"""Dielectric material definition.""" from ansys.api.edb.v1 import debye_model_pb2_grpc import ansys.api.edb.v1.debye_model_pb2 as pb from google.protobuf import empty_pb2 @@ -24,7 +24,7 @@ def set_frequency_range_message(target, low, high): class DebyeModel(DielectricMaterialModel): - """Class representing a debye dielectric material model object.""" + """Representa a Debye dielectric material model object.""" __stub: debye_model_pb2_grpc.DebyeModelServiceStub = session.StubAccessor( session.StubType.debye_model @@ -32,7 +32,7 @@ class DebyeModel(DielectricMaterialModel): @classmethod def create(cls): - """Create a Debye Dielectric Material Model. + """Create a Debye dielectric material model. Returns ------- @@ -86,7 +86,7 @@ def loss_tangent_at_high_low_frequency(self, freq): @property def is_relative_permitivity_enabled_at_optical_frequency(self): - """bool: Whether the relative permitivity at optical frequency is enabled.""" + """bool: Flag indicating whether the relative permitivity at optical frequency is enabled.""" return self.__stub.IsRelativePermitivityEnabledAtOpticalFrequency(self.msg).value @is_relative_permitivity_enabled_at_optical_frequency.setter @@ -97,7 +97,7 @@ def is_relative_permitivity_enabled_at_optical_frequency(self, enabled): @property def use_dc_conductivity(self): - """bool: Whether DC conductivity nominal value is used.""" + """bool: Flag indicating whether the DC conductivity nominal value is used.""" return self.__stub.UseDCConductivity(self.msg).value @use_dc_conductivity.setter diff --git a/src/ansys/edb/core/definition/die_property.py b/src/ansys/edb/core/definition/die_property.py index 36f29ad759..634acd5f12 100644 --- a/src/ansys/edb/core/definition/die_property.py +++ b/src/ansys/edb/core/definition/die_property.py @@ -1,4 +1,4 @@ -"""Die Property.""" +"""Die property.""" from enum import Enum @@ -12,7 +12,7 @@ class DieOrientation(Enum): - """Enum representing die orientations. + """Provides an enum representing die orientations. - CHIP_UP - CHIP_DOWN @@ -23,7 +23,7 @@ class DieOrientation(Enum): class DieType(Enum): - """Enum representing die types. + """Provides an enum representing die types. - NONE - FLIPCHIP @@ -36,7 +36,7 @@ class DieType(Enum): class DieProperty(ObjBase): - """Class representing a Die Property.""" + """Represents a die property.""" __stub: DiePropertyServiceStub = StubAccessor(StubType.die_property) @@ -59,7 +59,7 @@ def clone(self): Returns ------- DieProperty - The cloned die property created. + Cloned die property created. """ return DieProperty(self.__stub.Clone(messages.edb_obj_message(self))) @@ -76,7 +76,7 @@ def die_type(self, value): def height(self): """:class:`Value `: Height of the die property. - Property can be set with :term:`ValueLike` + This attribute can be set with the :term:`ValueLike` term. """ return Value(self.__stub.GetHeight(messages.edb_obj_message(self))) diff --git a/src/ansys/edb/core/definition/dielectric_material_model.py b/src/ansys/edb/core/definition/dielectric_material_model.py index d0bf25ecbb..2f552c0b32 100644 --- a/src/ansys/edb/core/definition/dielectric_material_model.py +++ b/src/ansys/edb/core/definition/dielectric_material_model.py @@ -1,4 +1,4 @@ -"""Dielectric Material Definition.""" +"""Dielectric material definition.""" from enum import Enum from ansys.api.edb.v1 import dielectric_material_model_pb2_grpc @@ -8,7 +8,7 @@ class DielectricMaterialModelType(Enum): - """Enum representing dielectric material model type. + """Provides an eum representing dielectric material model types. - DEBYE - MULTIPOLE_DEBYE @@ -21,7 +21,7 @@ class DielectricMaterialModelType(Enum): class DielectricMaterialModel(ObjBase): - """Class representing a dielectric material model object.""" + """Represents a dielectric material model object.""" __stub: dielectric_material_model_pb2_grpc.DielectricMaterialModelServiceStub = ( session.StubAccessor(session.StubType.dielectric_material_model) diff --git a/src/ansys/edb/core/definition/djordjecvic_sarkar_model.py b/src/ansys/edb/core/definition/djordjecvic_sarkar_model.py index 1bd6353e38..047a06ef72 100644 --- a/src/ansys/edb/core/definition/djordjecvic_sarkar_model.py +++ b/src/ansys/edb/core/definition/djordjecvic_sarkar_model.py @@ -1,4 +1,4 @@ -"""Dielectric Material Definition.""" +"""Dielectric material definition.""" from ansys.api.edb.v1 import djordjecvic_sarkar_model_pb2_grpc from google.protobuf import empty_pb2 @@ -8,7 +8,7 @@ class DjordjecvicSarkarModel(DielectricMaterialModel): - """Class representing a Djordjecvic-Sarkar dielectric material model object.""" + """Represents a Djordjecvic-Sarkar dielectric material model object.""" __stub: djordjecvic_sarkar_model_pb2_grpc.DjordjecvicSarkarModelServiceStub = ( session.StubAccessor(session.StubType.djordecvic_sarkar_model) @@ -26,7 +26,7 @@ def create(cls): @property def use_dc_relative_conductivity(self): - """:obj:`bool`: Whether the DC relative permitivity nominal value is used.""" + """:obj:`bool`: Flag indicating whether the DC relative permitivity nominal value is used.""" return self.__stub.UseDCRelativePermitivity(self.msg).value @use_dc_relative_conductivity.setter @@ -35,7 +35,7 @@ def use_dc_relative_conductivity(self, enabled): @property def frequency(self): - """:obj:`float`: Get the frequency.""" + """:obj:`float`: Frequency.""" return self.__stub.GetFrequency(self.msg).value @frequency.setter @@ -44,7 +44,7 @@ def frequency(self, frequency): @property def relative_permitivity_at_frequency(self): - """:obj:`float`: Get the relative permitivity frequency.""" + """:obj:`float`: Relative permitivity frequency.""" return self.__stub.GetRelativePermitivityAtFrequency(self.msg).value @relative_permitivity_at_frequency.setter @@ -55,7 +55,7 @@ def relative_permitivity_at_frequency(self, frequency): @property def loss_tangent_at_frequency(self): - """:obj:`float`: Get the loss tangent at frequency.""" + """:obj:`float`: Loss tangent at frequency.""" return self.__stub.GetLossTangentAtFrequency(self.msg).value @loss_tangent_at_frequency.setter @@ -64,7 +64,7 @@ def loss_tangent_at_frequency(self, frequency): @property def dc_relative_permitivity(self): - """:obj:`float`: Get the dc relative permitivity.""" + """:obj:`float`: DC relative permitivity.""" return self.__stub.GetDCRelativePermitivity(self.msg).value @dc_relative_permitivity.setter @@ -73,7 +73,7 @@ def dc_relative_permitivity(self, permitivity): @property def dc_conductivity(self): - """:obj:`float`: Get the dc conductivity.""" + """:obj:`float`: DC conductivity.""" return self.__stub.GetDCConductivity(self.msg).value @dc_conductivity.setter diff --git a/src/ansys/edb/core/definition/ic_component_property.py b/src/ansys/edb/core/definition/ic_component_property.py index ce01088e5b..0e4a1c1a81 100644 --- a/src/ansys/edb/core/definition/ic_component_property.py +++ b/src/ansys/edb/core/definition/ic_component_property.py @@ -1,4 +1,4 @@ -"""IC Component Property.""" +"""IC component property.""" from ansys.api.edb.v1.ic_component_property_pb2_grpc import ICComponentPropertyServiceStub import google.protobuf.empty_pb2 as empty_pb2 @@ -14,14 +14,14 @@ class ICComponentProperty(component_property.ComponentProperty): - """Class representing a ICComponent Property.""" + """Representing an IC component property.""" __stub: ICComponentPropertyServiceStub = StubAccessor(StubType.ic_component_property) @classmethod def create(cls): """ - Create IC Component Property. + Create an IC component property. Returns ------- diff --git a/src/ansys/edb/core/definition/io_component_property.py b/src/ansys/edb/core/definition/io_component_property.py index 45b0c533d8..39b005939a 100644 --- a/src/ansys/edb/core/definition/io_component_property.py +++ b/src/ansys/edb/core/definition/io_component_property.py @@ -1,4 +1,4 @@ -"""IO Component Property.""" +"""IO component property.""" from ansys.api.edb.v1.io_component_property_pb2_grpc import IOComponentPropertyServiceStub import google.protobuf.empty_pb2 as empty_pb2 @@ -9,14 +9,14 @@ class IOComponentProperty(component_property.ComponentProperty): - """Class representing a I0Component Property.""" + """Represents an I0 component property.""" __stub: IOComponentPropertyServiceStub = StubAccessor(StubType.io_component_property) @classmethod def create(cls): """ - Create IO Component Property. + Create an IO component property. Returns ------- diff --git a/src/ansys/edb/core/definition/material_def.py b/src/ansys/edb/core/definition/material_def.py index 0ef5a23a19..d479a0c9e1 100644 --- a/src/ansys/edb/core/definition/material_def.py +++ b/src/ansys/edb/core/definition/material_def.py @@ -1,4 +1,4 @@ -"""Material Definition.""" +"""Material definition.""" from enum import Enum @@ -12,7 +12,7 @@ class MaterialProperty(Enum): - """Enum representing property types. + """Provides an enum representing property types. - PERMITTIVITY Permittivity property. @@ -55,7 +55,7 @@ class MaterialProperty(Enum): class ThermalModifier(ObjBase): - """Class representing a thermal modifier model.""" + """Represents a thermal modifier model.""" class _QueryBuilder: @@ -139,72 +139,73 @@ def material_def_set_anisotropic_thermal_modifier_message( class MaterialDef(ObjBase): - """Class representing a material definition.""" + """Represents a material definition.""" __stub: MaterialDefServiceStub = StubAccessor(StubType.material) @classmethod def create(cls, database, name, **kwargs): - """Create a material definition into the given database. + """Create a material definition in the given database. Parameters ---------- database : :class:`Database ` - Database that will own the material definition. + Database to create the material definition in. name : str - Name of the material definition being created. + Name of the material definition. kwargs : dict{ str : :class:`Value ` } - Dictionary to be converted to MaterialDefPropertiesMessage.\ - Dict key is the material property name.\ - Dict value is the material property value.\ - Expected keys for kwargs: - - permittivity - - permeability - - conductivity - - dielectric_loss_tangent - - magnetic_loss_tangent - - thermal_conductivity - - mass_density - - specific_heat - - youngs_modulus - - poissons_ratio - - thermal_expansion_coefficient + Dictionary to convert to MaterialDefPropertiesMessage. + Dictionary key is the material property name. + Dictionary value is the material property value. + Expected keys for kwargs are: + + - permittivity + - permeability + - conductivity + - dielectric_loss_tangent + - magnetic_loss_tangent + - thermal_conductivity + - mass_density + - specific_heat + - youngs_modulus + - poissons_ratio + - thermal_expansion_coefficient Returns ------- MaterialDef - The new material definition object. + Material definition object created. """ return MaterialDef(cls.__stub.Create(_QueryBuilder.create(database, name, **kwargs))) @classmethod def find_by_name(cls, database, name): - """Find a material definition in the database with given name. + """Find a material definition in the database by name. Parameters ---------- database : :class:`Database ` - Database that owns the material definition. + Database to search for the material definition. name : str Name of the material definition. Returns ------- MaterialDef - The material definition object found. + Naterial definition object found. """ return MaterialDef(cls.__stub.FindByName(messages.edb_obj_name_message(database, name))) @property def definition_type(self): - """:class:`DefinitionObjType`: type.""" + """:class:`DefinitionObjType`: Type of the material definition.""" return DefinitionObjType.MATERIAL_DEF @property def name(self): """:obj:`str`: Name of the material definition. - Read-Only. + This attribute is read-only. """ return self.__stub.GetName(messages.edb_obj_message(self)).value @@ -222,20 +223,20 @@ def dielectric_material_model(self, dielectric): self.__stub.SetDielectricMaterialModel(messages.pointer_property_message(self, dielectric)) def delete(self): - """Delete a material definition.""" + """Delete the material definition.""" self.__stub.Delete(messages.edb_obj_message(self)) def set_property(self, material_property, value, component_id=None, col=None, row=None): - """Set a property value of a material. + """Set a property value of the material. Parameters ---------- material_property : :class:`MaterialProperty` - Property id. + Property ID. value : :class:`Value ` - Property value returned. + New value. component_id : int, optional - Component id. + Component ID. row : int, optional Tensor row. col : int, optional @@ -246,18 +247,18 @@ def set_property(self, material_property, value, component_id=None, col=None, ro ) def get_property(self, material_property, component_id=None, row=None, col=None): - """Set a property value of a material. + """Set a property value of the material. Parameters ---------- material_property : :class:`MaterialProperty` - Property id. + Property ID. The default is ``None``. component_id : int, optional - Component id. + Component ID. The default is ``None``. row : int, optional - Tensor row. + Tensor row. The default is ``None``. col : int, optional - Tensor column. + Tensor column. The default is ``None``. Returns ------- @@ -271,23 +272,23 @@ def get_property(self, material_property, component_id=None, row=None, col=None) ) def get_all_properties(self): - """Set a property value of a material. + """Get all property value of the material. Returns ------- list [:class:`MaterialProperty`] - List with Material Properties of the material definition. + List of properties for the material definition. """ msg = self.__stub.GetAllProperties(messages.edb_obj_message(self)) return [MaterialProperty(i) for i in msg.properties] def remove_property(self, material_property): - """Remove a property value of a material def. + """Remove the value from a material property. Parameters ---------- material_property : :class:`MaterialProperty` - Property id. + Property ID. """ self.__stub.RemoveProperty( _QueryBuilder.get_property( @@ -296,13 +297,15 @@ def remove_property(self, material_property): ) def get_dimensions(self, material_property_id): - """Get dimensions of a material definition Simple 1x1, Anisotropic 3x1, Tensor 3x3. + """Get dimensions of a material definition. + + Types are Simple 1x1, Anisotropic 3x1, and Tensor 3x3. Parameters ---------- material_property_id : \ :class:`MaterialProperty` - Property id. + Property ID. Returns ------- @@ -322,13 +325,13 @@ def get_dimensions(self, material_property_id): return [msg.tensor.col, msg.tensor.row] def get_thermal_modifier(self, material_property_id): - """Get thermal modifier of the material definition. + """Get the thermal modifier of a material definition. Parameters ---------- material_property_id : \ :class:`MaterialProperty` - Property id. + Property ID. Returns ------- @@ -342,15 +345,15 @@ def get_thermal_modifier(self, material_property_id): ) def set_thermal_modifier(self, material_property_id, thermal_modifier): - """Set thermal modifier of the material definition. + """Set the thermal modifier of the material definition. Parameters ---------- material_property_id : \ :class:`MaterialProperty` - Property id. + Property ID. thermal_modifier : ThermalModifier - Thermal modifier to be set to the material definition. + Thermal modifier to set to the material definition. """ self.__stub.SetThermalModifier( _QueryBuilder.material_def_set_thermal_modifier_message( @@ -359,15 +362,15 @@ def set_thermal_modifier(self, material_property_id, thermal_modifier): ) def get_anisotropic_thermal_modifier(self, material_property_id, component_id): - """Get anisotropic thermal modifier of a material def. + """Get the anisotropic thermal modifier of a material definition. Parameters ---------- material_property_id : \ :class:`MaterialProperty` - Property id. + Property ID. component_id : int - Component id. + Component ID. Returns ------- @@ -385,17 +388,17 @@ def get_anisotropic_thermal_modifier(self, material_property_id, component_id): def set_anisotropic_thermal_modifier( self, material_property_id, component_id, thermal_modifier ): - """Set anisotropic thermal modifier of a material def. + """Set the anisotropic thermal modifier of a material definition. Parameters ---------- material_property_id : \ :class:`MaterialProperty` - Property id. + Property ID. component_id : int - Component id + Component ID. thermal_modifier : :class:`ThermalModifier ` - Anisotropic thermal modifier to be set to the material definition + Anisotropic thermal modifier to set to the material definition. """ self.__stub.SetAnisotropicThermalModifier( _QueryBuilder.material_def_set_anisotropic_thermal_modifier_message( diff --git a/src/ansys/edb/core/definition/material_property_thermal_modifier.py b/src/ansys/edb/core/definition/material_property_thermal_modifier.py index b211724a05..5ee9f6a220 100644 --- a/src/ansys/edb/core/definition/material_property_thermal_modifier.py +++ b/src/ansys/edb/core/definition/material_property_thermal_modifier.py @@ -1,4 +1,4 @@ -"""Material Property Thermal Modifier.""" +"""Material property thermal modifier.""" from ansys.api.edb.v1 import material_property_thermal_modifier_pb2_grpc import ansys.api.edb.v1.material_def_pb2 as pb @@ -28,7 +28,7 @@ def create(basic_quadratic_params, advanced_quadratic_params): class MaterialPropertyThermalModifier(ObjBase): - """Class representing material property thermal modifiers.""" + """Representing material property thermal modifiers.""" __stub: material_property_thermal_modifier_pb2_grpc.MaterialPropertyThermalModifierServiceStub = StubAccessor( StubType.material_property_thermal_modifier @@ -41,14 +41,14 @@ def create(cls, basic_quadratic_params=None, advanced_quadratic_params=None): Parameters ---------- basic_quadratic_params: :class:`BasicQuadraticParams ` - Thermal Modifier basic parameters needed. + Basic parameters needed for the thermal modifier. advanced_quadratic_params : :class:`AdvancedQuadraticParams ` - Thermal Modifier advanced parameters. + Advanced parameeteres needed for the thermal modifier advanced parameters. Returns ------- MaterialPropertyThermalModifier - The new material property thermal modifiers. + Material property thermal modifiers created. """ if basic_quadratic_params is None: basic_quadratic_params = BasicQuadraticParams() @@ -70,7 +70,7 @@ def quadratic_model_params(self): PropVal(Temp) = PropValRef[1 + C1(Temp - TempRef) + C2(Temp - TempRef)^2] where PropValRef = The original property value without the thermal modifier applied - Read-Only. + This attribute is read-only. """ msg = self.__stub.GetQuadraticModelParams(messages.edb_obj_message(self)) return BasicQuadraticParams( @@ -89,6 +89,6 @@ def quadratic_model_params(self): def expression(self): """:class:`Value `: Expression value representing the thermal modifier. - Read-Only. + This attribute is read-only. """ return Value(self.__stub.GetThermalModifierExpression(messages.edb_obj_message(self))) diff --git a/src/ansys/edb/core/definition/multipole_debye_model.py b/src/ansys/edb/core/definition/multipole_debye_model.py index ea3174b071..2d23294a7e 100644 --- a/src/ansys/edb/core/definition/multipole_debye_model.py +++ b/src/ansys/edb/core/definition/multipole_debye_model.py @@ -1,4 +1,4 @@ -"""Dielectric Material Definition.""" +"""Dielectric material definition.""" from ansys.api.edb.v1 import multipole_debye_model_pb2_grpc import ansys.api.edb.v1.multipole_debye_model_pb2 as pb from google.protobuf import empty_pb2 @@ -31,7 +31,7 @@ def set_multipole_debye_model_params(target, frequencies, permitivities, loss_ta class MultipoleDebyeModel(DielectricMaterialModel): - """Class representing a dielectric material model.""" + """Represents a dielectric material model.""" __stub: multipole_debye_model_pb2_grpc.MultipoleDebyeModelServiceStub = session.StubAccessor( session.StubType.multipole_debye_model @@ -39,7 +39,7 @@ class MultipoleDebyeModel(DielectricMaterialModel): @classmethod def create(cls): - """Create a Multipole Debye Dielectric Material Model. + """Create a multipole Debye dielectric material model. Returns ------- diff --git a/src/ansys/edb/core/definition/package_def.py b/src/ansys/edb/core/definition/package_def.py index 9ca598068c..6fa0a28641 100644 --- a/src/ansys/edb/core/definition/package_def.py +++ b/src/ansys/edb/core/definition/package_def.py @@ -1,4 +1,4 @@ -"""Package Def Definition.""" +"""Package definition.""" from ansys.api.edb.v1 import package_def_pb2_grpc @@ -22,20 +22,20 @@ class PackageDef(ObjBase): - """Class representing a package definition.""" + """Represents a package definition.""" __stub: package_def_pb2_grpc.PackageDefServiceStub = StubAccessor(StubType.package_def) @classmethod def create(cls, db, name): - """Create a Package definition object. + """Create a package definition object. Parameters ---------- db :class:`Database ` - Database in which we save the Package Definition. + Database to create the package definition in. name : str - Name of the Package Definition. + Name of the package definition. Returns ------- @@ -45,7 +45,14 @@ def create(cls, db, name): @classmethod def find_by_name(cls, db, name): - """Find a Package definition object by name. + """Find a package definition object by name. + + Parameters + ---------- + db :class:`Database ` + Database to search for the package definition. + name : str + Name of the package definition. Returns ------- @@ -55,7 +62,14 @@ def find_by_name(cls, db, name): @classmethod def find_by_id(cls, db, uid): - """Find a Package definition object by Id. + """Find a package definition object by ID. + + Parameters + ---------- + db :class:`Database ` + Database to search for the package definition. + UID : int + Unique identifier for the package definition. Returns ------- @@ -65,12 +79,12 @@ def find_by_id(cls, db, uid): @property def definition_type(self): - """:class:`DefinitionObjType`: type.""" + """:class:`DefinitionObjType`: Type.""" return DefinitionObjType.PACKAGE_DEF @property def name(self): - """:obj:`str`: Name of the Package definition object.""" + """:obj:`str`: Name of the package definition object.""" return self.__stub.GetName(edb_obj_message(self)).value @name.setter @@ -80,7 +94,7 @@ def name(self, value): @property @parser.to_polygon_data def exterior_boundary(self): - """:class:`PolygonData `: Exterior boundary for package definition.""" + """:class:`PolygonData `: Exterior boundary for the package definition.""" return self.__stub.GetExteriorBoundary(edb_obj_message(self)) @exterior_boundary.setter @@ -89,7 +103,7 @@ def exterior_boundary(self, boundary): @property def height(self): - """:class:`Value `: Height of the package definition object.""" + """:class:`Value `: Height of the package.""" return Value(self.__stub.GetHeight(edb_obj_message(self))) @height.setter @@ -125,7 +139,7 @@ def thermal_conductivity(self, conductivity): @property def theta_jb(self): - """:class:`Value `: Theta_JB (junction to board) of the package.""" + """:class:`Value `: Theta JB (junction to board) of the package.""" return Value(self.__stub.GetTheta_JB(edb_obj_message(self))) @theta_jb.setter @@ -134,7 +148,7 @@ def theta_jb(self, theta): @property def theta_jc(self): - """:class:`Value `: Theta_JC (junction to case) of the package.""" + """:class:`Value `: Theta JC (junction to case) of the package.""" return Value(self.__stub.GetTheta_JC(edb_obj_message(self))) @theta_jc.setter @@ -143,7 +157,7 @@ def theta_jc(self, theta): @property def heat_sink(self): - """:class:`HeatSink `: Assigned heat sink model for the package definition.""" + """:class:`HeatSink `: Assigned heat sink model for the package.""" heat_sink_paramaters = self.__stub.GetHeatSink(edb_obj_message(self)) return HeatSink( heat_sink_paramaters.thickness, @@ -158,7 +172,7 @@ def heat_sink(self, heat_sink_value): self.__stub.SetHeatSink(set_heat_sink_message(self, heat_sink_value)) def delete(self): - """Delete the Package definition.""" + """Delete the package definition.""" self.__stub.Delete(edb_obj_message(self)) def get_product_property(self, prod_id, attr_it): @@ -174,14 +188,14 @@ def get_product_property(self, prod_id, attr_it): Returns ------- str - Property value returned. + Property value for the specified product and attribute IDs. """ return self.__stub.GetProductProperty( get_product_property_message(self, prod_id, attr_it) ).value def set_product_property(self, prod_id, attr_it, prop_value): - """Set the product property associated with the given product and attribute ids. + """Set the product property associated with the given product and attribute IDs. Parameters ---------- @@ -190,14 +204,14 @@ def set_product_property(self, prod_id, attr_it, prop_value): attr_it : int Attribute ID. prop_value : str - Product property's new value + New value for the product property. """ self.__stub.SetProductProperty( set_product_property_message(self, prod_id, attr_it, prop_value) ) def get_product_property_ids(self, prod_id): - """Get a list of attribute ids corresponding to a product property id. + """Get the list of attribute IDS for a given property ID. Parameters ---------- @@ -207,7 +221,7 @@ def get_product_property_ids(self, prod_id): Returns ------- list[int] - The attribute ids associated with this product property. + List of attribute IDs for the givens product ID. """ attr_ids = self.__stub.GetProductPropertyIds( get_product_property_ids_message(self, prod_id) diff --git a/src/ansys/edb/core/definition/padstack_def.py b/src/ansys/edb/core/definition/padstack_def.py index c63b15422e..f19674159f 100644 --- a/src/ansys/edb/core/definition/padstack_def.py +++ b/src/ansys/edb/core/definition/padstack_def.py @@ -1,4 +1,4 @@ -"""Padstack Definition.""" +"""Padstack definition.""" from ansys.api.edb.v1 import padstack_def_pb2_grpc import ansys.api.edb.v1.padstack_def_pb2 as pb @@ -10,16 +10,17 @@ class _PadstackDefQueryBuilder: - """Class for creating grpc messages of PadstackDef.""" + """Provides for creating gRPC messages for the padstack definition.""" @staticmethod def padstack_def_string_message(target, name): - """Create a PadstackDefStringMessage. + """Create a string message for the padstack definition. Parameters ---------- target: :class:`Database ` or PadstackDef name : str + Name of the string message. Returns ------- @@ -29,14 +30,14 @@ def padstack_def_string_message(target, name): @staticmethod def padstack_def_set_data_message(target, data): - """Create a PadstackDefSetDataMessage. + """Create a data message for the padstack definition. Parameters ---------- target: PadstackDef - PadstackDef target to change. + Padstack definition target. data : :class:`PadstackDefData ` - PadstackDefData data to be set on the PadstackDef + Data message to create on the padstack definition. Returns ------- @@ -46,25 +47,25 @@ def padstack_def_set_data_message(target, data): class PadstackDef(ObjBase): - """Class representing a padstack definition.""" + """Represents a padstack definition.""" __stub: padstack_def_pb2_grpc.PadstackDefServiceStub = StubAccessor(StubType.padstack_def) @classmethod def create(cls, db, name): - """Create a PadstackDef object. + """Create a padstack definition object. Parameters ---------- db : :class:`Database ` - Database object which will create the PadstackDef. + Database object to create the padstack definition in. name : str - Data to be set on the PadstackDef. + Data to set on the padstack definition. Returns ------- PadstackDef - PadstackDef that was created in the given database. + Padstack definition created in the given database. """ return PadstackDef( cls.__stub.Create(_PadstackDefQueryBuilder.padstack_def_string_message(db, name)) @@ -72,14 +73,14 @@ def create(cls, db, name): @classmethod def find_by_name(cls, db, name): - """Find a PadstackDef by name. + """Find a padstack definition by name. Parameters ---------- db : :class:`Database `. - Database in which we search for the PadstackDef. + Database to search for the padstack definition. name : str - Name of PadstackDef. + Name of the padstack definition. Returns ------- @@ -91,21 +92,21 @@ def find_by_name(cls, db, name): @property def definition_type(self): - """:class:`DefinitionObjType`: type.""" + """:class:`DefinitionObjType`: Type.""" return DefinitionObjType.PADSTACK_DEF @property def name(self): - """:obj:`str`: Name of the PadstackDef. + """:obj:`str`: Name of the padstack definition. - Read-Only. + This attribute is read-only. """ return self.__stub.GetName(self.msg).value @property def data(self): """:class:`PadstackDefData `: \ - PadstackDefData of the PadstackDef.""" + Data of the Padstack definition.""" return PadstackDefData(self.__stub.GetData(self.msg)) @data.setter @@ -113,5 +114,5 @@ def data(self, data): self.__stub.SetData(_PadstackDefQueryBuilder.padstack_def_set_data_message(self, data)) def delete(self): - """Delete a PadstackDef.""" + """Delete the padstack definition.""" self.__stub.Delete(self.msg) diff --git a/src/ansys/edb/core/definition/padstack_def_data.py b/src/ansys/edb/core/definition/padstack_def_data.py index 52c2df23bd..9343985fb0 100644 --- a/src/ansys/edb/core/definition/padstack_def_data.py +++ b/src/ansys/edb/core/definition/padstack_def_data.py @@ -1,4 +1,4 @@ -"""Padstack Definition Data.""" +"""Padstack definition data.""" from __future__ import annotations @@ -15,7 +15,7 @@ class _PadstackDefDataQueryBuilder: - """Class for creating padstack def data grpc messages.""" + """Provides for creating gRPC messages for padstack definition data.""" if TYPE_CHECKING: from padstack_def_data import PadstackDefData @@ -148,7 +148,7 @@ def padstack_def_data_set_solder_ball_material_message(target, material): class PadType(Enum): - """Enum representing Pad types. + """Provides an enum representing pad types. - REGULAR_PAD Regular pad. @@ -170,7 +170,7 @@ class PadType(Enum): class PadGeometryType(Enum): - """Enum representing Pad Geometry types. + """Provides an enum representing pad geometry types. - PADGEOMTYPE_NO_GEOMETRY No geometry. @@ -216,7 +216,7 @@ class PadGeometryType(Enum): class PadstackHoleRange(Enum): - """Enum representing Pad Hole ranges. + """Provides an enum representing pad hole ranges. - THROUGH Hole through all layers of the board. @@ -238,7 +238,7 @@ class PadstackHoleRange(Enum): class SolderballShape(Enum): - """Enum representing Solderball shapes. + """Provides an enum representing solderball shapes. - NO_SOLDERBALL No solder ball. @@ -257,7 +257,7 @@ class SolderballShape(Enum): class SolderballPlacement(Enum): - """Enum representing Solderball placement. + """Provides an enum representing solderball placement. - ABOVE_PADSTACK Solder ball is placed above the padstack. @@ -273,7 +273,7 @@ class SolderballPlacement(Enum): class PadstackDefData(ObjBase): - """Class representing a padstack data definition.""" + """Represents a padstack data definition.""" __stub: PadstackDefDataServiceStub = StubAccessor(StubType.padstack_def_data) @@ -291,7 +291,7 @@ def create(cls): @property def material(self): - """:obj:`str`: Material name of the hole of the PadstackDefData object.""" + """:obj:`str`: Material name of the hole of the padstack definition daata object.""" return self.__stub.GetMaterial(self.msg) @material.setter @@ -302,16 +302,16 @@ def material(self, name): @property def layer_names(self): - """:obj:`list` of :obj:`str`: List of layer names in the PadstackDefData object. + """:obj:`list` of :obj:`str`: List of layer names in the padstack definition data object. - Read-Only. + This attribute is read-only. """ layer_names_msg = self.__stub.GetLayerNames(self.msg).names return layer_names_msg @property def layer_ids(self): - """:obj:`list` of :obj:`int`: List of layer ids in the PadstackDefData object. + """:obj:`list` of :obj:`int`: List of layer IDs in the padstack definition data object. Read-Only. """ @@ -320,7 +320,7 @@ def layer_ids(self): def add_layers(self, names): """ - Add a list of layers of given names into the PadstackDefData object. + Add a list of layers of given names to the padstack definition data object. Parameters ---------- @@ -333,7 +333,7 @@ def add_layers(self, names): def get_pad_parameters(self, layer, pad_type): """ - Get a pad's parameters by layer name and pad type in its original value in database. + Get a pad's parameters by layer name and pad type in its original value in the database. Parameters ---------- @@ -400,7 +400,7 @@ def set_pad_parameters( self, layer, pad_type, offset_x, offset_y, rotation, type_geom=None, sizes=None, fp=None ): """ - Set a pad's parameters by layer name and pad type in its original value in database. + Set a pad's parameters by layer name and pad type in its original value in the database. Parameters ---------- @@ -414,12 +414,12 @@ def set_pad_parameters( Y offset. rotation : :class:`Value ` Rotation. - type_geom : PadGeometryType - Pad geometry type. None if setting polygonal pad parameters. + type_geom : PadGeometryType, optional + Pad geometry type. The default is ``None`` if setting polygonal pad parameters. sizes : List[:class:`Value `] - Pad parameters. None if setting polygonal pad parameters. + Pad sizes. The default is ``None`` if setting polygonal pad parameters. fp : :class:`PolygonData ` - Polygon geometry. None if not setting polygonal pad parameters. + Polygon geometry. The default is ``None`` if not setting polygonal pad parameters. """ self.__stub.SetPadParameters( _PadstackDefDataQueryBuilder.padstack_def_data_set_pad_parameters_message( @@ -429,7 +429,7 @@ def set_pad_parameters( def get_hole_parameters(self): """ - Get hole parameter in its original value in database. + Get hole parameters in their original values in the database. Returns ------- @@ -470,6 +470,10 @@ def set_hole_parameters(self, offset_x, offset_y, rotation, type_geom, sizes): Y offset. rotation : :class:`Value ` Rotation. + type_geom : PadGeometryType, optional + Pad geometry type. The default is ``None`` if setting polygonal pad parameters. + sizes : List[:class:`Value `] + Pad sizes. The default is ``None`` if setting polygonal pad parameters. """ return self.set_pad_parameters( -1, PadType.HOLE, offset_x, offset_y, rotation, type_geom, sizes @@ -477,7 +481,7 @@ def set_hole_parameters(self, offset_x, offset_y, rotation, type_geom, sizes): @property def hole_range(self): - """:class:`PadstackHoleRange`: Hole range of the PadstackDefData.""" + """:class:`PadstackHoleRange`: Hole range of the padstack definition data.""" return PadstackHoleRange(self.__stub.GetHoleRange(self.msg).hole_range) @hole_range.setter @@ -514,7 +518,7 @@ def solder_ball_shape(self, solderball_shape): @property def solder_ball_placement(self): - """:class:`SolderballPlacement`: Solder ball placement/orientation.""" + """:class:`SolderballPlacement`: Solder ball placement or orientation.""" return SolderballPlacement(self.__stub.GetSolderBallPlacement(self.msg)) @solder_ball_placement.setter @@ -528,7 +532,7 @@ def solder_ball_placement(self, solderball_placement): @property def solder_ball_param(self): """ - Get solder ball parameters in its original value in database. + Get solder ball parameters in their original values in the database. Returns ------- @@ -540,9 +544,9 @@ def solder_ball_param(self): Returns a tuple of the following format: **(d1, d2)** - **d1** : Diameter for cylinder solder ball or Top diameter for spheroid solder ball. + **d1** : Diameter for a cylinder solder ball or top diameter for a spheroid solder ball. - **d2** : Middle diameter for spheroid solder ball. Not used for cylinder solder ball. + **d2** : Middle diameter for a spheroid solder ball. Not used for a cylinder solder ball. """ params = self.__stub.GetSolderBallParam(self.msg) return ( diff --git a/src/ansys/edb/core/definition/port_property.py b/src/ansys/edb/core/definition/port_property.py index f94a234bbc..0fa84d6267 100644 --- a/src/ansys/edb/core/definition/port_property.py +++ b/src/ansys/edb/core/definition/port_property.py @@ -1,4 +1,4 @@ -"""Port Property.""" +"""Port property.""" from ansys.api.edb.v1.port_property_pb2_grpc import PortPropertyServiceStub import google.protobuf.empty_pb2 as empty_pb2 @@ -9,7 +9,7 @@ class PortProperty(ObjBase): - """Class representing a Port Property.""" + """Represents a port property.""" __stub: PortPropertyServiceStub = StubAccessor(StubType.port_property) @@ -32,7 +32,7 @@ def clone(self): Returns ------- PortProperty - The cloned port property created. + Clone of port property created. """ return PortProperty(self.__stub.Clone(messages.edb_obj_message(self))) @@ -40,7 +40,7 @@ def clone(self): def reference_height(self): """:class:`Value `: Reference height of the port property. - Property can be set with :term:`ValueLike` + This attribute can be set with the :term:`ValueLike` term. """ return Value(self.__stub.GetReferenceHeight(messages.edb_obj_message(self))) @@ -60,7 +60,7 @@ def reference_size_auto(self, auto): self.__stub.SetReferenceSizeAuto(messages.bool_property_message(self, auto)) def get_reference_size(self): - r"""Get the X and Y reference size for the port property. + r"""Get the X and Y reference sizes for the port property. Returns ------- @@ -74,7 +74,7 @@ def get_reference_size(self): return Value(value_pair_message.val1), Value(value_pair_message.val2) def set_reference_size(self, ref_x, ref_y): - """Set the X and Y reference size for the port property. + """Set the X and Y reference sizes for the port property. Parameters ---------- diff --git a/src/ansys/edb/core/definition/rlc_component_property.py b/src/ansys/edb/core/definition/rlc_component_property.py index b315ee0e73..02c39ed97a 100644 --- a/src/ansys/edb/core/definition/rlc_component_property.py +++ b/src/ansys/edb/core/definition/rlc_component_property.py @@ -1,4 +1,4 @@ -"""RLC Component Property.""" +"""RLC component property.""" from ansys.api.edb.v1.rlc_component_property_pb2_grpc import RLCComponentPropertyServiceStub import google.protobuf.empty_pb2 as empty_pb2 @@ -9,14 +9,14 @@ class RLCComponentProperty(ComponentProperty): - """Class representing a RLCComponentProperty Property.""" + """Represents an RLC component property.""" __stub: RLCComponentPropertyServiceStub = StubAccessor(StubType.rlc_component_property) @classmethod def create(cls): """ - Create RLC Component Property. + Create an RLC component property. Returns ------- @@ -27,7 +27,7 @@ def create(cls): @property def enabled(self): - """:obj:`bool`: True if enabled, false otherwise.""" + """:obj:`bool`: Flag indicating if the RLC component property is enabled.""" return self.__stub.GetEnabled(messages.edb_obj_message(self)).value @enabled.setter diff --git a/src/ansys/edb/core/definition/solder_ball_property.py b/src/ansys/edb/core/definition/solder_ball_property.py index d3ecefb7e0..3b1fd1c269 100644 --- a/src/ansys/edb/core/definition/solder_ball_property.py +++ b/src/ansys/edb/core/definition/solder_ball_property.py @@ -1,4 +1,4 @@ -"""Solder Ball Property.""" +"""Solder ball property.""" from ansys.api.edb.v1.padstack_def_data_pb2 import SolderballShape import ansys.api.edb.v1.solder_ball_property_pb2 as pb @@ -53,7 +53,7 @@ def set_placement_message(target, placement): class SolderBallProperty(ObjBase): - """Class representing a solder ball property.""" + """Represents a solder ball property.""" __stub: SolderBallPropertyServiceStub = StubAccessor(StubType.solder_ball_property) @@ -93,9 +93,9 @@ def get_diameter(self): Returns ------- diameter1 : :term:`ValueLike` - Solder ball property's diameter 1. + Diameter 1 of the solder ball property. diameter2 : :term:`ValueLike` - Solder ball property's diameter 2. + Diameter 2 of the solder ball property. """ diameter_paramaters = self.__stub.GetDiameter(edb_obj_message(self)) return Value(diameter_paramaters.diameter1), Value(diameter_paramaters.diameter2) @@ -106,15 +106,15 @@ def set_diameter(self, diameter1, diameter2): Parameters ---------- diameter1 : :term:`ValueLike` - Solder ball property's diameter 1. + Diameter 1 of the solder ball property. diameter2 : :term:`ValueLike` - Solder ball property's diameter 2. + Diameter 2 of the solder ball property. """ self.__stub.SetDiameter(_QueryBuilder.set_diameter_message(self, diameter1, diameter2)) @property def uses_solderball(self): - """:obj:`bool`: Whether solder ball is used. + """:obj:`bool`: Flag indicating if the solder ball is used. Read-Only. """ @@ -145,6 +145,6 @@ def clone(self): Returns ------- SolderBallProperty - The cloned solder ball property created. + Clone of the solder ball property created. """ return SolderBallProperty(self.__stub.Clone(edb_obj_message(self))) diff --git a/src/ansys/edb/core/edb_defs.py b/src/ansys/edb/core/edb_defs.py index 7840129aba..b728c2e12d 100644 --- a/src/ansys/edb/core/edb_defs.py +++ b/src/ansys/edb/core/edb_defs.py @@ -7,7 +7,7 @@ class LayoutObjType(enum.Enum): - """Layout Object type.""" + """Provides an enum representing layout object types.""" INVALID_LAYOUT_OBJ = layout_obj_pb2.INVALID_LAYOUT_OBJ PRIMITIVE = layout_obj_pb2.PRIMITIVE @@ -30,7 +30,7 @@ class LayoutObjType(enum.Enum): class DefinitionObjType(enum.Enum): """ - Definition Object Type. + Provides an enum representing definition object types. - PADSTACK_DEF Padstack definition. diff --git a/src/ansys/edb/core/session.py b/src/ansys/edb/core/session.py index 8daaa00b13..e0a03b188d 100644 --- a/src/ansys/edb/core/session.py +++ b/src/ansys/edb/core/session.py @@ -147,10 +147,10 @@ class StubAccessor(object): - """A descriptor to assign specific stub to a model.""" + """Provides a descriptor for assignig a specific stub to a model.""" def __init__(self, stub_type): - """Initialize a descriptor stub with name and stub service. + """Initialize a descriptor stub with a name and stub service. Parameters ---------- @@ -159,7 +159,7 @@ def __init__(self, stub_type): self.__stub_name = stub_type.name def __get__(self, instance=None, owner=None): - """Return the corresponding stub service if a session is active.""" + """Get the corresponding stub service if a session is active.""" if MOD.current_session is not None: return MOD.current_session.stub(self.__stub_name) raise EDBSessionException(ErrorCode.NO_SESSIONS) @@ -281,9 +281,9 @@ def wait_server_ready(self): local_server_proc_output = self.local_server_proc.stdout.readline() stdout = local_server_proc_output.decode().rstrip() - if not stdout.startswith("Server listening on 127.0.0.1"): + if not stdout.startswith("Server listening on 127.0.0.1."): try: - print("local server failed to start properly. trying to gracefully shutdown...") + print("Local server failed to start properly. Trying to shut down gracefully...") if self.local_server_proc.wait(10): self._on_server_startup_error() except subprocess.TimeoutExpired: @@ -317,7 +317,7 @@ def stop_server(self): class StubType(Enum): - """Enum representing available service stubs.""" + """Provides an enum representing available service stub types.""" cell = CellServiceStub database = DatabaseServiceStub @@ -430,14 +430,15 @@ class StubType(Enum): def attach_session(ip_address=None, port_num=50051): - """Attach a session to a port running EDB API server. + """Attach a session to a port running the EDB API server. Parameters ---------- ip_address : str, optional - ip address of the machine running a server. localhost by default. + IP address of the machine that is running the server. The default is ``None``, + in which case localhost is used. port_num : int, optional - port number of the server to listen to. 50051 by default. + Port number that the server is listening on. The default is ``50051``. """ MOD.current_session = _Session(ip_address, port_num, None) MOD.current_session.connect() @@ -452,13 +453,14 @@ def launch_session(ansys_em_root, port_num=None): Parameters ---------- ansys_em_root : str - The installation directory of EDB_RPC_Server.exe + Directory where the ``EDB_RPC_Server.exe`` file is installed. port_num : int, optional - The port number to listen on + Port number to listen on. The default is ``None``, in which + case local host is used. Examples -------- - Creates a session and disconnects it + Create a session and then disconnect it >>> session = launch_session("C:\\Program Files\\AnsysEM\\v231\\Win64", 50051) >>> # program goes here @@ -483,16 +485,20 @@ def session(ansys_em_root, port_num, ip_address=None): Parameters ---------- ansys_em_root : str - The installation directory of EDB_RPC_Server.exe + Directory where the ``EDB_RPC_Server.exe`` file is installed. port_num : int - The port number to listen on + Port number to listen on. The default is ``None``. ip_address : str, optional - Currently not supported. Default value means local_host. It specifies the IP address of the machine where \ - the server executable is running. Future releases will support remotely running the API on another machine. + IP address where the server executable file is running. The default is ``None``, in which + case local host is used. + + .. note:: + This parameter is currently not supported. In future releases, this parameter is to + support remotely running the API on another machine. Examples -------- - Creates a session that will automatically disconnect when it goes out of scope. + Create a session that automatically disconnects when it goes out of scope. >>> with session("C:\\Program Files\\AnsysEM\\v231\\Win64", 50051): >>> # program goes here @@ -510,7 +516,7 @@ def session(ansys_em_root, port_num, ip_address=None): def get_layer_collection_stub(): - """Get Layer collection stub. + """Get the layer collection stub. Returns ------- @@ -520,7 +526,7 @@ def get_layer_collection_stub(): def get_stackup_layer_stub(): - """Get Stackup layer stub. + """Get the stackup layer stub. Returns ------- @@ -530,7 +536,7 @@ def get_stackup_layer_stub(): def get_via_layer_stub(): - """Get Via layer stub. + """Get the via layer stub. Returns ------- @@ -540,7 +546,7 @@ def get_via_layer_stub(): def get_variable_server_stub(): - """Get VariableServer stub. + """Get the variable server stub. Returns -------