Skip to content

Commit 950af3c

Browse files
authored
Merge branch 'main' into patch-1
2 parents da062bc + 4fad138 commit 950af3c

File tree

7 files changed

+47
-20
lines changed

7 files changed

+47
-20
lines changed

.github/workflows/build_documentation.yml

+22-10
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
vale-version: "2.29.6"
3131

3232
docs_build:
33-
runs-on: ubuntu-20.04
33+
runs-on: ubuntu-latest
3434

3535
steps:
3636
- uses: actions/checkout@v4
@@ -74,26 +74,38 @@ jobs:
7474

7575
- name: Install doc build requirements
7676
run: |
77-
sudo apt install graphviz
77+
sudo apt update
78+
sudo apt install graphviz texlive-latex-extra latexmk texlive-xetex texlive-fonts-extra -y
7879
7980
# run doc build, without creating the examples directory
8081
# note that we have to add the examples file here since it won't
8182
# be created as gallery is disabled on linux.
82-
- name: Documentation Build
83+
- name: Documentation Build (HTML)
8384
run: |
8485
make -C doc clean
8586
mkdir doc/source/examples -p
8687
echo $'Examples\n========' > doc/source/examples/index.rst
87-
make -C doc html SPHINXOPTS="-j auto -w build_errors.txt -N"
88+
make -C doc phtml-no-examples SPHINXOPTS="-j auto -w build_errors.txt -N"
8889
8990
# Verify that sphinx generates no warnings
9091
- name: Check for warnings
9192
run: |
9293
python doc/print_errors.py
9394
94-
# - name: Upload Documentation
95-
# uses: actions/upload-artifact@v4
96-
# with:
97-
# name: Documentation
98-
# path: doc/_build/html
99-
# retention-days: 7
95+
- name: Upload Documentation
96+
uses: actions/upload-artifact@v4
97+
with:
98+
name: Documentation
99+
path: doc/_build/html
100+
retention-days: 7
101+
102+
- name: Documentation Build (PDF)
103+
run: |
104+
make -C doc pdf-no-examples
105+
106+
- name: Upload documentation PDF artifact
107+
uses: actions/upload-artifact@v4
108+
with:
109+
name: Documentation-pdf
110+
path: doc/_build/latex/*.pdf
111+
retention-days: 7

_unittest_solvers/conftest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
settings.enable_error_handler = False
3636
settings.enable_desktop_logs = False
3737
settings.desktop_launch_timeout = 180
38-
38+
settings.release_on_exception = False
3939

4040
from pyaedt.aedt_logger import pyaedt_logger
4141
from pyaedt.generic.general_methods import generate_unique_name

doc/Makefile

+10
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,22 @@ clean:
2929
phtml:
3030
$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -j auto
3131

32+
phtml-no-examples:
33+
export PYAEDT_SKIP_EXAMPLE="1"
34+
$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -j auto
35+
3236
# Build pdf docs.
3337
pdf:
3438
@$(SPHINXBUILD) -M latex "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
3539
cd $(BUILDDIR)/latex && latexmk -r latexmkrc -pdf *.tex -interaction=nonstopmode || true
3640
(test -f $(BUILDDIR)/latex/pyaedt.pdf && echo pdf exists) || exit 1
3741

42+
pdf-no-examples:
43+
export PYAEDT_SKIP_EXAMPLE="1"
44+
@$(SPHINXBUILD) -M latex "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
45+
cd $(BUILDDIR)/latex && latexmk -r latexmkrc -pdf *.tex -interaction=nonstopmode || true
46+
(test -f $(BUILDDIR)/latex/PyAEDT-Documentation-*.pdf && echo pdf exists) || exit 1
47+
3848
# build docs like the CI build
3949
cibuild:
4050
mkdir source/examples -p

doc/make.bat

+4-1
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,13 @@ goto end
3333
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
3434

3535
:pdf
36+
set PYAEDT_SKIP_EXAMPLE=1
37+
38+
3639
%SPHINXBUILD% -M latex %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
3740
cd "%BUILDDIR%\latex"
3841
for %%f in (*.tex) do (
39-
pdflatex "%%f" --interaction=nonstopmode)
42+
xelatex "%%f" --interaction=nonstopmode)
4043

4144
:end
4245
popd

doc/source/User_guide/modeler.rst

-6
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,3 @@ All objects support executing any modeler operation, such as union or subtractio
5757
cyl = hfss.modeler["mycyl"]
5858
box.unite(cyl)
5959
box.subract(cyl)
60-
61-
62-
.. image:: ../Resources/objects_operations.gif
63-
:width: 800
64-
:alt: Object Modeler Operations
65-

doc/source/conf.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ def setup(app):
100100
copyright = f"(c) {datetime.datetime.now().year} ANSYS, Inc. All rights reserved"
101101
author = "Ansys Inc."
102102
cname = os.getenv("DOCUMENTATION_CNAME", "nocname.com")
103+
switcher_version = get_version_match(__version__)
103104

104105
# Check for the local config file, otherwise use default desktop configuration
105106
local_config_file = os.path.join(local_path, "local_config.json")
@@ -134,6 +135,7 @@ def setup(app):
134135
"sphinx.ext.inheritance_diagram",
135136
"numpydoc",
136137
"ansys_sphinx_theme.extension.linkcode",
138+
"recommonmark",
137139
]
138140

139141
# Intersphinx mapping
@@ -266,7 +268,7 @@ def setup(app):
266268
# necessary for pyvista when building the sphinx gallery
267269
pyvista.BUILDING_GALLERY = True
268270

269-
if config["run_examples"]:
271+
if config["run_examples"] and not os.environ.get("PYAEDT_SKIP_EXAMPLE", False):
270272
extensions.append("sphinx_gallery.gen_gallery")
271273

272274
sphinx_gallery_conf = {
@@ -340,6 +342,12 @@ def setup(app):
340342
"url": "https://github.com/ansys/pyaedt/discussions",
341343
"icon": "fa fa-comment fa-fw",
342344
},
345+
{
346+
"name": "Download documentation in PDF",
347+
"url": f"https://{cname}/version/{switcher_version}/_static/assets/download/pyaedt.pdf",
348+
# noqa: E501
349+
"icon": "fa fa-file-pdf fa-fw",
350+
},
343351
],
344352
"switcher": {
345353
"json_url": f"https://{cname}/versions.json",

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ doc = [
8282
"pypandoc>=1.10.0,<1.14",
8383
#"pytest-sphinx",
8484
"pyvista>=0.38.0,<0.44",
85-
#"recommonmark",
85+
"recommonmark",
8686
#"scikit-learn",
8787
"scikit-rf>=0.30.0,<0.33",
8888
"Sphinx==5.3.0; python_version == '3.7'",

0 commit comments

Comments
 (0)