Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
44c6465
Testing the pymapdl.convert_script by adding vm12
clatapie Dec 28, 2022
a5edbfa
Trying to change a doc dependency
clatapie Dec 29, 2022
ec93aa4
Using Sphinx Gallery with VM files
clatapie Jan 16, 2023
98aaf74
Sphinx Gallery with VM files
clatapie Jan 16, 2023
781a264
Fixing issues
clatapie Jan 16, 2023
45cda8f
Fixing the level error for the doc building
clatapie Jan 16, 2023
712549d
Undo the last commit
clatapie Jan 16, 2023
0971f30
Fixing the doc building issue
clatapie Jan 16, 2023
08dbb13
Fixing issues
clatapie Jan 17, 2023
a236ab4
Merge branch 'main' into maint/vm_examples
clatapie Jan 17, 2023
586ed16
Reverting back to Sphinx 5.3.0
clatapie Jan 18, 2023
48a5f76
Merge branch 'main' into maint/vm_examples
clatapie Jan 19, 2023
8f15a9e
Modifying requirement file
clatapie Jan 20, 2023
3b42203
Adding the cache for examples and doc build dir
clatapie Jan 20, 2023
920db61
Fixing a typo in the cache setup
clatapie Jan 20, 2023
7c764b2
Fixing pyansys/actions setups
clatapie Jan 20, 2023
0ba0eff
Fixing the cache
clatapie Jan 20, 2023
6be8e37
Fixing the toctrees
clatapie Jan 23, 2023
f8d80d9
checking mapdl output
Jan 23, 2023
5f473b0
Testing using previous pymapdl version
clatapie Jan 23, 2023
5c52f46
Reverting the pymapdl version
clatapie Jan 23, 2023
25fa1f5
Merge branch 'maint/vm_examples' of https://github.com/pyansys/pymapd…
Jan 23, 2023
c99f344
Merge branch 'main' into maint/vm_examples
clatapie Jan 27, 2023
efd11b8
Updating the example link
clatapie Jan 27, 2023
d2904bf
Update doc/source/conf.py
clatapie Jan 27, 2023
5437fb7
Merge branch 'main' into maint/vm_examples
clatapie Jan 31, 2023
89c3bf9
Reverting changes
clatapie Jan 31, 2023
322dfab
Merge branch 'maint/vm_examples' of https://github.com/pyansys/pymapd…
clatapie Jan 31, 2023
94f0efd
Adding run_location parameter
clatapie Feb 1, 2023
06598a9
Merge branch 'main' into maint/vm_examples
clatapie Feb 1, 2023
b13f15d
Trying to fix the launch_mapdl issue
clatapie Feb 2, 2023
7a4847d
Merge branch 'maint/vm_examples' of https://github.com/pyansys/pymapd…
clatapie Feb 2, 2023
b4f6274
Reverting run_location parameter
clatapie Feb 2, 2023
8bce59a
CICD modification
clatapie Feb 2, 2023
1477e69
Updating CICD by adding doc-style
clatapie Feb 2, 2023
e872c13
Removing doc-style to first solve the issue
clatapie Feb 2, 2023
1b7fc3b
Checking error is not coming from index file
clatapie Feb 2, 2023
5edd173
Activating command output
germa89 Feb 2, 2023
29bc088
Merge branch 'maint/vm_examples' of https://github.com/pyansys/pymapd…
germa89 Feb 2, 2023
51832e2
Changing the gallery summaries
clatapie Feb 3, 2023
ee57cb0
Merge branch 'maint/vm_examples' of https://github.com/pyansys/pymapd…
clatapie Feb 3, 2023
284d81d
Adding the vm12 caracteritics
clatapie Feb 3, 2023
69a69b6
Fixing VM12 page
clatapie Feb 3, 2023
3881a51
Adding the doc style check + VM files changes
clatapie Feb 3, 2023
6e9a8b6
Fixing Vale
clatapie Feb 3, 2023
396c327
Fixing Vale report
clatapie Feb 3, 2023
349703a
Fixing Vale report
clatapie Feb 3, 2023
1e9f8e0
Fixing Vale report
clatapie Feb 3, 2023
981d4ff
Sortting accept.txt + fixing Vale report
clatapie Feb 3, 2023
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
74 changes: 45 additions & 29 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ on:

env:
MAIN_PYTHON_VERSION: '3.9'
RESET_EXAMPLES_CACHE: 0
RESET_DOC_BUILD_CACHE: 0

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -40,27 +42,18 @@ jobs:
- name: Test with tox
run: tox -e style

# docs-style:
# name: Documentation Style Check
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3

# - name: Running Vale
# uses: errata-ai/vale-action@reviewdog
# env:
# GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
# with:
# files: doc
# reporter: github-pr-check
# level: error
# filter_mode: nofilter
# fail_on_error: true
# vale_flags: "--config=doc/.vale.ini"

docs:
name: Documentation
needs: [style] #docs-style
doc-style:
name: Documentation Style Check
runs-on: ubuntu-latest
steps:
- name: PyAnsys documentation style checks
uses: pyansys/actions/doc-style@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}

doc-build:
name: Documentation building
needs: [style, doc-style]
runs-on: ubuntu-latest
env:
PYMAPDL_PORT: 21000 # default won't work on GitHub runners
Expand All @@ -71,7 +64,8 @@ jobs:
DPF_PORT: 21002

steps:
- uses: actions/checkout@v3
- name: "Install Git and checkout project"
uses: actions/checkout@v3

- name: "Set up Python using cache"
uses: actions/setup-python@v4
Expand All @@ -97,7 +91,7 @@ jobs:
uses: docker/login-action@v2.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
username: ${{ secrets.GH_USERNAME }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pull, launch, and validate MAPDL service
Expand All @@ -108,18 +102,40 @@ jobs:

- name: Retrieve PyMAPDL version
run: |
echo "{PYMAPDL_VERSION}={$(python -c 'from ansys.mapdl.core import __version__; print(__version__)')}" >> $GITHUB_OUTPUT
echo "PYMAPDL_VERSION=$(python -c 'from ansys.mapdl.core import __version__; print(__version__)')" >> $GITHUB_ENV
echo "PyMAPDL version is: $(python -c "from ansys.mapdl.core import __version__; print(__version__)")"
id: version

- name: DPF Server Activation
run: |
docker pull ghcr.io/pyansys/dpf-core:22.2dev
docker run -d --name dpfserver -p ${{ env.DPF_PORT }}:50052 ghcr.io/pyansys/dpf-core:22.2dev && echo "DPF Server active on port ${{ env.DPF_PORT }}."

- name: Build Documentation
run: |
xvfb-run make -C doc html SPHINXOPTS="-j auto -W --keep-going"
- name: "Cache Verification Manual examples"
uses: actions/cache@v3
with:
path: doc/source/verif-manual
key: Examples-v${{ env.RESET_EXAMPLES_CACHE }}-${{ env.PYMAPDL_VERSION }}-${{ github.sha }}
restore-keys: |
Examples-v${{ env.RESET_EXAMPLES_CACHE }}-${{ env.PYMAPDL_VERSION }}

- name: "Cache docs build directory"
uses: actions/cache@v3
with:
path: doc/_build
key: doc-build-v${{ env.RESET_DOC_BUILD_CACHE }}-${{ env.PYMAPDL_VERSION }}-${{ github.sha }}
restore-keys: |
doc-build-v${{ env.RESET_DOC_BUILD_CACHE }}-${{ env.PYMAPDL_VERSION }}

- name: "Run Ansys documentation building action"
uses: pyansys/actions/doc-build@v3
with:
requires-xvfb: true
python-version: ${{ env.MAIN_PYTHON_VERSION }}
checkout: false
skip-install: true
sphinxopts: -j auto
use-python-cache: False

- name: Upload HTML Documentation
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -200,7 +216,7 @@ jobs:

release:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
needs: [style, docs] #docs-style
needs: [style, doc-build] #docs-style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ instance/

# Sphinx documentation
doc/_build/
doc/source/verif-manual/*

# PyBuilder
.pybuilder/
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PyMAPDL Examples
================

Repository holding examples for PyMAPDL.
This repository holds examples for PyMAPDL.


How to install
Expand Down
2 changes: 1 addition & 1 deletion doc/.vale.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
StylesPath = "styles"

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

# By default, `code` and `tt` are ignored.
IgnoredScopes = code, tt
Expand Down
2 changes: 1 addition & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ help:
.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

Expand Down
1 change: 0 additions & 1 deletion doc/source/_static/README.md

This file was deleted.

Binary file added doc/source/_static/vm12_setup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 30 additions & 3 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
"""Sphinx documentation configuration file."""
from datetime import datetime
import os

from ansys.mapdl import core as pymapdl
from ansys_sphinx_theme import pyansys_logo_black as logo
import numpy as np
import pyvista
from sphinx_gallery.sorting import FileNameSortKey

# Project information
project = "pymapdl-examples"
Expand All @@ -22,7 +27,7 @@
"additional_breadcrumbs": [
("PyAnsys", "https://docs.pyansys.com/"),
("PyMAPDL", "https://mapdl.docs.pyansys.com/"),
("Examples", "https://mapdl.docs.pyansys.com/examples/"),
("Examples", "https://mapdl.docs.pyansys.com/dev/examples/index.html"),
],
"icon_links": [
{
Expand Down Expand Up @@ -54,16 +59,18 @@
# convert rst to md for ipynb
"pypandoc": True,
# path to your examples scripts
"examples_dirs": [],
"examples_dirs": ["../../examples/verif-manual"],
# path where to save gallery generated examples
"gallery_dirs": ["verif-manual", "technology_showcase_examples"],
# Pattern to search for example files
"filename_pattern": r"\.py",
# Remove the "Download all examples" button from the top level gallery
"download_all_examples": False,
# Sort gallery example by file name instead of number of lines (default)
"within_subsection_order": FileNameSortKey,
# directory where function granular galleries are stored
"backreferences_dir": None,
# Modules for which function level galleries are created. In
# Modules for which function level galleries are created. In
"doc_module": "ansys-mapdl-core",
"image_scrapers": ("pyvista", "matplotlib"),
"ignore_pattern": "flycheck*",
Expand All @@ -83,7 +90,9 @@
}

# numpydoc configuration
numpydoc_use_plots = True
numpydoc_show_class_members = False
numpydoc_class_members_toctree = False
numpydoc_xref_param_type = True

# Image referencing
Expand All @@ -107,6 +116,24 @@
# type, unless multiple values are being returned"
}

# Manage errors
pyvista.set_error_output_file("errors.txt")

# Ensure that offscreen rendering is used for docs generation
pyvista.OFF_SCREEN = True

# must be less than or equal to the XVFB window size
pyvista.rcParams["window_size"] = np.array([1024, 768])

# Save figures in specified directory
pyvista.FIGURE_PATH = os.path.join(os.path.abspath("./images/"), "auto-generated/")
if not os.path.exists(pyvista.FIGURE_PATH):
os.makedirs(pyvista.FIGURE_PATH)


# necessary when building the sphinx gallery
pyvista.BUILDING_GALLERY = True
pymapdl.BUILDING_GALLERY = True

# static path
html_static_path = ["_static"]
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading