diff --git a/.github/workflows/build_documentation.yml b/.github/workflows/build_documentation.yml index a35b6f62d80..6ebc4ac2969 100644 --- a/.github/workflows/build_documentation.yml +++ b/.github/workflows/build_documentation.yml @@ -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 diff --git a/.github/workflows/build_examples.yml b/.github/workflows/build_examples.yml new file mode 100644 index 00000000000..e015392e2c5 --- /dev/null +++ b/.github/workflows/build_examples.yml @@ -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 + diff --git a/examples/02-HFSS/Array.py b/examples/02-HFSS/Array.py index 9564242c923..7eec78f329b 100644 --- a/examples/02-HFSS/Array.py +++ b/examples/02-HFSS/Array.py @@ -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 ----------------------------- @@ -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", @@ -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. @@ -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 @@ -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() @@ -79,8 +95,8 @@ 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. @@ -88,8 +104,8 @@ frequencies=[5e9]) ########################################################## -# Generate contour plot -# ~~~~~~~~~~~~~~~~~~~~~ +# ## Generate contour plot +# # Generate a contour plot. You can define the Theta scan # and Phi scan. @@ -97,8 +113,8 @@ 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. @@ -113,8 +129,8 @@ 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. @@ -122,8 +138,8 @@ 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. @@ -134,8 +150,11 @@ show=False) ########################################################## -# Release AEDT -# ~~~~~~~~~~~~ +# ## Release AEDT +# # Release AEDT. hfss.release_desktop() + +"" +