Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

D338: Overall doc review #337

Merged
merged 9 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
256 changes: 57 additions & 199 deletions README.rst
Original file line number Diff line number Diff line change
@@ -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
^^^^^^^^^^^^^^^^^^^^^^^^

<This instruction does not work until this package is released to PyPI. Go to "For developers" section instead.>

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 <https://edb.core.docs.pyansys.com/version/dev/index.html#>`_.
The documentation has five sections:

- `Getting started <https://edb.core.docs.pyansys.com/version/dev/getting_started/index.html#>`_: Describes
how to install PyEDB-Core in user mode.
- `User guide <https://edb.core.docs.pyansys.com/version/dev/user_guide/index.html>`_: Describes how to
use PyEDB-Core.
- `API reference <https://edb.core.docs.pyansys.com/version/dev/api/index.html>`_: Provides API member descriptions
and usage examples.
- `Examples <https://edb.core.docs.pyansys.com/version/dev/examples/index.html>`_: Provides examples showing
- end-to-end workflows for using PyEDB-Core.
- `Contribute <https://edb.core.docs.pyansys.com/version/dev/contribute.html>`_: 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 <https://github.com/ansys/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 <https://discuss.ansys.com/>`_ page on the Ansys Developer portal, you can post questions,
share ideas, and get community feedback.

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

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 local copy of AEDT. For more information, see the
`Ansys Electronics <https://www.ansys.com/products/electronics>`_ page on the Ansys website.
10 changes: 0 additions & 10 deletions doc/source/404.rst

This file was deleted.

2 changes: 1 addition & 1 deletion doc/source/_static/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Static files will be found here (like images and other assets).
Static files are found here (like images and other assets).
2 changes: 1 addition & 1 deletion doc/source/api/hierarchy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Hierarchy objects are :term:`Connectables <Connectable>` 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
Expand Down
8 changes: 2 additions & 6 deletions doc/source/api/index.rst
Original file line number Diff line number Diff line change
@@ -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 PyEDB-Core API classes, functions, and attributes.

*******
Modules
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api/layout_instance.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Layout Instance
Layout instance
===============

Classes
Expand Down
9 changes: 5 additions & 4 deletions doc/source/api/release_notes.rst
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/ansys/pyedb/issues/154>`_
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 <https://github.com/ansys/pyedb-core/issues/154>`_.
4 changes: 2 additions & 2 deletions doc/source/api/session.rst
Original file line number Diff line number Diff line change
@@ -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 server executable and creates a channel connection to that server. Once these
actions are completed, all EDB API function calls are processed using this channel.

Functions
---------
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api/simulation_setup.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Simulation Setup
Simulation setup
================

Classes
Expand Down
8 changes: 4 additions & 4 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand All @@ -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",
}
Expand All @@ -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,
Expand Down
Loading
Loading