Skip to content

Commit

Permalink
Merge branch 'develop' into SI_example_notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
svandenb-dev committed Jul 26, 2023
2 parents 1448527 + d03e5c7 commit 76ad510
Show file tree
Hide file tree
Showing 53 changed files with 2,008 additions and 552 deletions.
95 changes: 48 additions & 47 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
- release-*
workflow_dispatch:

env:
DOCUMENTATION_CNAME: 'edb.docs.pyansys.com'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -18,17 +21,9 @@ jobs:
name: Code style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- uses: ansys/actions/code-style@v4
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade -r requirements/requirements_tox.txt
- name: Test with tox
run: tox -e style


tests:
name: Tests and coverage
Expand All @@ -53,62 +48,41 @@ jobs:
# Only the tox environment specified in the tox.ini gh-actions is run
run: tox -e test -- --ignore=tests/e2e


docs:
doc-style:
name: Documentation
runs-on: ubuntu-latest
steps:
- name: "Check documentation style"
uses: ansys/actions/doc-style@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

# TODO: convert to ansys/actions/doc-build
doc-build:
name: Build documentation
runs-on: ubuntu-latest
needs: [doc-style]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Install dependencies
run: |
python -m pip install --upgrade -r requirements/requirements_tox.txt
- name: Generate the documentation with tox
run: tox -e doc

- name: Zip documentation
run: |
cd .tox/doc_out
zip -r pyedb_documentation.zip *
- name: Upload HTML Documentation
uses: actions/upload-artifact@v2
with:
name: HTML-Documentation
path: .tox/doc_out/pyedb_documentation.zip
path: .tox/doc_out
retention-days: 7

- name: Get Bot Application Token
if: github.event_name == 'push' && (github.ref == 'refs/heads/develop' || contains(github.ref, 'refs/tags'))
id: get_workflow_token
uses: peter-murray/workflow-application-token-action@v1
with:
application_id: ${{ secrets.BOT_APPLICATION_ID }}
application_private_key: ${{ secrets.BOT_APPLICATION_PRIVATE_KEY }}

- name: Deploy dev docs
if: github.event_name == 'push' && github.ref == 'refs/heads/develop'
uses: JamesIves/[email protected]
with:
repository-name: pyansys/pyedb-dev-docs
token: ${{ steps.get_workflow_token.outputs.token }}
branch: gh-pages
folder: .tox/doc_out
clean: true

- name: Deploy release docs
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
uses: JamesIves/[email protected]
with:
repository-name: pyansys/pyedb-docs
token: ${{ steps.get_workflow_token.outputs.token }}
branch: gh-pages
folder: .tox/doc_out
clean: true

build:
name: Build library
runs-on: ubuntu-latest
Expand Down Expand Up @@ -149,7 +123,7 @@ jobs:

release:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
needs: [build, tests, docs]
needs: [build, tests, doc-build]
runs-on: ubuntu-latest
steps:
- name: Set up Python
Expand Down Expand Up @@ -185,7 +159,7 @@ jobs:
job: ${{ toJson(job) }}
steps: ${{ toJson(steps) }}
overwrite: "{
title: `New release has been published at https://github.com/pyansys/pyedb/releases`,
title: `New release has been published at https://github.com/ansys/pyedb/releases`,
}"

- name: Notify Failure
Expand All @@ -199,3 +173,30 @@ jobs:
overwrite: "{
title: `Release FAILED!`,
}"

doc-deploy-dev:
name: "Deploy development documentation"
# Deploy development only when merging or pushing to the 'main' branch
if: github.event_name == 'push' && !contains(github.ref, 'refs/tags')
runs-on: ubuntu-latest
needs: [doc-build, build]
steps:
- uses: ansys/actions/doc-deploy-dev@v4
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
doc-artifact-name: HTML-Documentation

doc-deploy-stable:
name: "Deploy stable documentation"
# Deploy release documentation when creating a new tag
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
runs-on: ubuntu-latest
needs: release
steps:
- uses: ansys/actions/doc-deploy-stable@v4
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
doc-artifact-name: HTML-Documentation

6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ target/

# Jupyter Notebook
.ipynb_checkpoints
notebooks/
notebooks/results

# IPython
profile_default/
Expand Down Expand Up @@ -169,3 +169,7 @@ cython_debug/

# End of https://www.toptal.com/developers/gitignore/api/python

# Ansys EDB backups, etc.
**/*.aedb/**/*+
**/*.aedb/**/*.bak
**/*.aedb/**/*.tmp
15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,18 @@ repos:
^src/ansys/api/|
^protos
)
- repo: local
hooks:
- id: cleanipynb-helpers
name: cleanipynb-helpers
language: system
entry: python scripts/cleanipynb.py
files: notebooks/helpers/[^/]*\.ipynb$

- id: cleanipynb
name: cleanipynb
language: system
entry: python scripts/cleanipynb.py
args: [--leave-outputs]
files: notebooks/[^/]*\.ipynb$
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Pyedb

Ansys Electronics Database Python Client

.. image:: https://github.com/pyansys/pyedb/actions/workflows/ci_cd.yml/badge.svg?branch=develop
:target: https://github.com/pyansys/pyedb/actions/workflows/ci_cd.yml?query=branch%3Adevelop
.. 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
--------------
Expand Down Expand Up @@ -42,7 +42,7 @@ need to follow these steps:

.. code:: bash
git clone https://github.com/pyansys/pyedb
git clone https://github.com/ansys/pyedb
cd pyedb
2. Create a fresh-clean Python environment and activate it:
Expand Down
28 changes: 28 additions & 0 deletions doc/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Core settings
# =============

# Location of our `styles`
StylesPath = "styles"

# The options are `suggestion`, `warning`, or `error` (defaults to “warning”).
MinAlertLevel = warning

# By default, `code` and `tt` are ignored.
IgnoredScopes = code, tt

# By default, `script`, `style`, `pre`, and `figure` are ignored.
SkippedScopes = script, style, pre, figure

# WordTemplate specifies what Vale will consider to be an individual word.
WordTemplate = \b(?:%s)\b

# List of Packages to be used for our guidelines
Packages = Google

# Define the Ansys vocabulary
Vocab = Ansys

[*.{md,rst}]

# Apply the following styles
BasedOnStyles = Vale, Google
4 changes: 2 additions & 2 deletions doc/source/_templates/sidebar-nav-bs.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation">
<div class="bd-toc-item active">
{% if pagename.startswith("_autosummary") or pagename.startswith("api")%}
{{ generate_nav_html("sidebar", maxdepth=4, collapse=True, includehidden=True, titles_only=True) }}
{{ generate_toctree_html("sidebar", maxdepth=4, collapse=True, includehidden=True, titles_only=True) }}
{% else %}
{{ generate_nav_html("sidebar", maxdepth=4, collapse=False, includehidden=True, titles_only=True) }}
{{ generate_toctree_html("sidebar", maxdepth=4, collapse=False, includehidden=True, titles_only=True) }}
{% endif %}

</div>
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ API Reference
**This is a working document and will be changed without notice.**


This section gives an overview of the API for all the pyedb classes, functions, and attributes.
This section gives an overview of the API for all the classes, functions, and attributes.

*******
Modules
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ 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/pyansys/pyedb/issues/154>`_
* See `issue #154 <https://github.com/ansys/pyedb/issues/154>`_
34 changes: 25 additions & 9 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"""Sphinx documentation configuration file."""
from datetime import datetime
import os
import sys

from pyansys_sphinx_theme import pyansys_logo_black
from ansys_sphinx_theme import ansys_favicon, get_version_match, pyansys_logo_black

from ansys.edb import __version__

Expand All @@ -10,23 +12,40 @@
copyright = f"(c) {datetime.now().year} ANSYS, Inc. All rights reserved"
author = "ANSYS, Inc."
release = version = __version__
cname = os.getenv("DOCUMENTATION_CNAME", "<DEFAULT_CNAME>")

# use the default pyansys logo
html_logo = pyansys_logo_black
html_theme = "pyansys_sphinx_theme"
html_theme = "ansys_sphinx_theme"
html_short_title = html_title = "PyEDB"

html_short_title = html_title = "ansys-edb"
html_context = {
"github_user": "ansys",
"github_repo": "pyedb",
"github_version": "develop",
"doc_path": "doc/source",
}

# specify the location of your github repo
html_theme_options = {
"github_url": "https://github.com/pyansys/pyedb",
"switcher": {
"json_url": f"https://{cname}/versions.json",
"version_match": get_version_match(__version__),
},
"check_switcher": False,
"github_url": "https://github.com/ansys/pyedb",
"show_prev_next": False,
"show_breadcrumbs": True,
"collapse_navigation": True,
"use_edit_page_button": True,
"additional_breadcrumbs": [
("PyAnsys", "https://docs.pyansys.com/"),
],
}

html_favicon = ansys_favicon

html_static_path = ["_static"]

# Sphinx extensions
extensions = [
"sphinx.ext.autodoc",
Expand All @@ -38,7 +57,7 @@

# Intersphinx mapping
intersphinx_mapping = {
"python": ("https://docs.python.org/dev", None),
"python": (f"https://docs.python.org/{'.'.join((str(i) for i in sys.version_info[:2]))}", None),
# kept here as an example
# "scipy": ("https://docs.scipy.org/doc/scipy/reference", None),
# "numpy": ("https://numpy.org/devdocs", None),
Expand Down Expand Up @@ -73,9 +92,6 @@
notfound_template = "404.rst"
notfound_urls_prefix = "/../"

# static path
html_static_path = ["_static"]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

Expand Down
2 changes: 1 addition & 1 deletion doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pyedb Documentation

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 EDBs to disk. After that, those EDBs can be read into AEDT and simulated.
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.

Expand Down
9 changes: 2 additions & 7 deletions doc/source/user_guide/user_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ User Guide

**[Ansys Internal - Confidential]**

The classes and functions are in the **ansys.edb** namespace

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 EBD can then be imported into ANSYS Electronics Desktop.




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
4 changes: 4 additions & 0 deletions doc/styles/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*
!Vocab
!Vocab/**
!.gitignore
6 changes: 6 additions & 0 deletions doc/styles/Ansys/accept.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Ansys
Enums
PyAnsys
PyEDB
pyedb
EDB
Empty file added doc/styles/Ansys/reject.txt
Empty file.
Loading

0 comments on commit 76ad510

Please sign in to comment.