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

Add jupytext header #3899

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
12 changes: 6 additions & 6 deletions .github/workflows/build_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ jobs:
run: |
python doc/print_errors.py

# - name: Upload Documentation
# uses: actions/upload-artifact@v3
# with:
# name: Documentation
# path: doc/_build/html
# retention-days: 7
- name: Upload Documentation
uses: actions/upload-artifact@v3
with:
name: Documentation
path: doc/_build/html
retention-days: 7
107 changes: 107 additions & 0 deletions .github/workflows/build_examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Documentation with Examples

env:
python.version: '3.10'
python.venv: 'testvenv'
RESET_EXAMPLES_CACHE: 3
RESET_DOC_BUILD_CACHE: 3
RESET_AUTOSUMMARY_CACHE: 3

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches:
- 'doc/*'
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
tags:
description: 'Test scenario tags'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
full_documentation:
# The type of runner that the job will run on
name: full_documentation
runs-on: [windows-latest, pyaedt]
timeout-minutes: 480
strategy:
matrix:
python-version: ['3.10']
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: 'Create virtual env'
run: |
python -m venv testenv
testenv\Scripts\Activate.ps1
python -m pip install pip -U
python -m pip install wheel setuptools -U
python -c "import sys; print(sys.executable)"

- name: 'Install pyaedt'
run: |
testenv\Scripts\Activate.ps1
pip install .[doc]
Copy-Item -Path "C:\actions-runner\opengl32.dll" -Destination "testenv\Lib\site-packages\vtkmodules" -Force

- name: Retrieve PyAEDT version
id: version
run: |
testenv\Scripts\Activate.ps1
echo "::set-output name=PYAEDT_VERSION::$(python -c "from pyaedt import __version__; print(__version__)")"
echo "PyAEDT version is: $(python -c "from pyaedt import __version__; print(__version__)")"

- name: Create HTML Documentations
run: |
testenv\Scripts\Activate.ps1
sphinx-build -j auto --color -b html -a doc/source doc/_build/html

# - name: Create PDF Documentations
# run: |
# testenv\Scripts\Activate.ps1
# .\doc\make.bat pdf

- name: Upload HTML documentation artifact
uses: actions/upload-artifact@v3
with:
name: Documentation
path: doc/_build/html
retention-days: 7

# - name: Upload EDB Documentation
# uses: actions/upload-artifact@v3
# with:
# name: documentation-html-edb
# path: doc/_build/html/EDBAPI
# retention-days: 3

# - name: Upload PDF documentation artifact
# uses: actions/upload-artifact@v3
# with:
# name: documentation-pdf
# path: doc/_build/pdf
# retention-days: 7

# - name: Release
# uses: softprops/action-gh-release@v1
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
# with:
# generate_release_notes: true
# files: |
# doc/_build/pdf

73 changes: 46 additions & 27 deletions examples/02-HFSS/Array.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: sphinx
# format_version: '1.1'
# jupytext_version: 1.14.5
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
# name: python3
# ---

"""
HFSS: component antenna array
-----------------------------
Expand All @@ -6,31 +20,33 @@
PyVista without opening the HFSS user interface. This examples runs only on Windows using CPython.
"""
##########################################################
# Perform required imports
# ~~~~~~~~~~~~~~~~~~~~~~~~
# # Perform required imports
#
# Perform required imports.

import os
import pyaedt

##########################################################
# Set non-graphical mode
# ~~~~~~~~~~~~~~~~~~~~~~
# ## Set non-graphical mode
#
# Set non-graphical mode.
# You can set ``non_graphical`` either to ``True`` or ``False``.

non_graphical = False

##########################################################
# Download 3D component
# ~~~~~~~~~~~~~~~~~~~~~
# ## Download 3D component
#
# Download the 3D component that is needed to run the example.

example_path = pyaedt.downloads.download_3dcomponent()

##########################################################
# Launch HFSS and save project
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ## Launch HFSS and save project
#
# Launch HFSS and save the project.

project_name = pyaedt.generate_unique_project_name(project_name="array")
hfss = pyaedt.Hfss(projectname=project_name,
specified_version="2023.2",
Expand All @@ -41,12 +57,12 @@
print("Project name " + project_name)

##########################################################
# Read array definition from JSON file
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ## Read array definition from JSON file
#
# Read the array definition from a JSON file. A JSON file
# can contain all information needed to import and set up a
# full array in HFSS.
#
#
# If a 3D component is not available in the design, it is loaded
# into the dictionary from the path that you specify. The following
# code edits the dictionary to point to the location of the A3DCOMP file.
Expand All @@ -57,8 +73,8 @@
array = hfss.add_3d_component_array_from_json(dict_in)

##########################################################
# Modify cells
# ~~~~~~~~~~~~
# ## Modify cells
#
# Make center element passive and rotate corner elements.

array.cells[1][1].is_active = False
Expand All @@ -68,8 +84,8 @@
array.cells[2][2].rotation = 90

##########################################################
# Set up simulation
# ~~~~~~~~~~~~~~~~~
# ## Set up simulation
#
# Set up a simulation and analyze it.

setup = hfss.create_setup()
Expand All @@ -79,26 +95,26 @@
hfss.analyze(num_cores=4)

##########################################################
# Get far field data
# ~~~~~~~~~~~~~~~~~~
# ## Get far field data
#
# Get far field data. After the simulation completes, the far
# field data is generated port by port and stored in a data class.

ffdata = hfss.get_antenna_ffd_solution_data(sphere_name="Infinite Sphere1", setup_name=hfss.nominal_adaptive,
frequencies=[5e9])

##########################################################
# Generate contour plot
# ~~~~~~~~~~~~~~~~~~~~~
# ## Generate contour plot
#
# Generate a contour plot. You can define the Theta scan
# and Phi scan.

ffdata.plot_farfield_contour(qty_str='RealizedGain', convert_to_db=True,
title='Contour at {}Hz'.format(ffdata.frequency))

##########################################################
# Generate 2D cutout plots
# ~~~~~~~~~~~~~~~~~~~~~~~~
# ## Generate 2D cutout plots
#
# Generate 2D cutout plots. You can define the Theta scan
# and Phi scan.

Expand All @@ -113,17 +129,17 @@
convert_to_db=True)

##########################################################
# Generate 3D polar plots in Matplotlib
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ## Generate 3D polar plots in Matplotlib
#
# Generate 3D polar plots in Matplotlib. You can define
# the Theta scan and Phi scan.

ffdata.polar_plot_3d(qty_str='RealizedGain',
convert_to_db=True)

##########################################################
# Generate 3D plots in PyVista
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ## Generate 3D plots in PyVista
#
# Generate 3D plots in PyVista. You can define the Theta and Phi
# scan angles. You can change the easy-to-use interactive plot
# that is generated on the fly.
Expand All @@ -134,8 +150,11 @@
show=False)

##########################################################
# Release AEDT
# ~~~~~~~~~~~~
# ## Release AEDT
#
# Release AEDT.

hfss.release_desktop()

""

Loading