Skip to content

Commit 9199890

Browse files
committed
Merge branch 'fix/doc_generation_2' into fix/remove_grid_cache
2 parents 7d647c8 + 6087460 commit 9199890

File tree

10 files changed

+71
-13
lines changed

10 files changed

+71
-13
lines changed

.ci/build_doc.bat

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ call sphinx-apidoc -o ../docs/source/api ../ansys ../ansys/dpf/core/log.py ^
33
../ansys/dpf/core/help.py ../ansys/dpf/core/mapping_types.py ../ansys/dpf/core/ipconfig.py ^
44
../ansys/dpf/core/field_base.py ../ansys/dpf/core/cache.py ../ansys/dpf/core/misc.py ^
55
../ansys/dpf/core/check_version.py ../ansys/dpf/core/operators/build.py ../ansys/dpf/core/operators/specification.py ^
6-
../ansys/dpf/core/vtk_helper.py ../ansys/dpf/core/label_space.py ^
6+
../ansys/dpf/core/vtk_helper.py ../ansys/dpf/core/label_space.py ../ansys/dpf/core/examples/python_plugins/* ^
7+
../ansys/dpf/core/examples/examples.py ^
78
-f --implicit-namespaces --separate --no-headings
89
pushd .
910
cd ../docs/
1011
call make clean
11-
call make html
12+
call make html -v -v -v -P
1213
popd

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,10 @@ jobs:
243243
- name: "Setup Graphviz"
244244
uses: ts-graphviz/setup-graphviz@v1
245245

246+
- name: "Install OS packages"
247+
run: |
248+
choco install pandoc
249+
246250
- name: "Install documentation packages for Python"
247251
run: |
248252
pip install -r requirements/requirements_docs.txt

docs/make.bat

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ set SOURCEDIR=source
1111
set BUILDDIR=build
1212

1313
if "%1" == "" goto help
14+
if "%1" == "clean" goto clean
1415

1516
%SPHINXBUILD% >NUL 2>NUL
1617
if errorlevel 9009 (
@@ -28,6 +29,30 @@ if errorlevel 9009 (
2829
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
2930
goto end
3031

32+
:clean
33+
echo.Cleaning files form previous build...
34+
IF EXIST "build" (
35+
rmdir "build" /s /q
36+
)
37+
IF EXIST "source\images\auto-generated" (
38+
rmdir "source\images\auto-generated" /s /q
39+
)
40+
IF EXIST "source\examples\07-python-operators\plugins" (
41+
robocopy "source\examples\07-python-operators\plugins" "source\_temp\plugins" /E >nul 2>&1
42+
)
43+
IF EXIST "source\examples" (
44+
rmdir "source\examples" /s /q
45+
)
46+
IF EXIST "source\_temp\plugins" (
47+
robocopy "source\_temp\plugins" "source\examples\07-python-operators\plugins" /E >nul 2>&1
48+
)
49+
IF EXIST "source\_temp" (
50+
rmdir "source\_temp" /s /q
51+
)
52+
53+
echo.Done.
54+
goto end
55+
3156
:help
3257
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
3358

docs/source/conf.py

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767

6868
autosummary_generate = True
6969

70+
autodoc_mock_imports = ["ansys.dpf.core.examples.python_plugins"]
7071

7172
# Add any paths that contain templates here, relative to this directory.
7273
# templates_path = ['_templates']
@@ -85,7 +86,7 @@
8586
#
8687
# This is also used if you do content translation via gettext catalogs.
8788
# Usually you set "language" from the command line for these cases.
88-
language = None
89+
language = "en"
8990

9091
# List of patterns, relative to source directory, that match files and
9192
# directories to ignore when looking for source files.
@@ -99,6 +100,28 @@
99100
# -- Sphinx Gallery Options
100101
from sphinx_gallery.sorting import FileNameSortKey
101102

103+
104+
def reset_servers(gallery_conf, fname, when):
105+
import psutil
106+
from ansys.dpf.core import server
107+
import gc
108+
109+
gc.collect()
110+
server.shutdown_all_session_servers()
111+
112+
proc_name = "Ans.Dpf.Grpc"
113+
nb_procs = 0
114+
for proc in psutil.process_iter():
115+
try:
116+
# check whether the process name matches
117+
if proc_name in proc.name():
118+
# proc.kill()
119+
nb_procs += 1
120+
except psutil.NoSuchProcess:
121+
pass
122+
print(f"Counted {nb_procs} {proc_name} processes {when} the example.")
123+
124+
102125
sphinx_gallery_conf = {
103126
# convert rst to md for ipynb
104127
"pypandoc": True,
@@ -118,18 +141,24 @@
118141
# 'first_notebook_cell': ("%matplotlib inline\n"
119142
# "from pyvista import set_plot_theme\n"
120143
# "set_plot_theme('document')"),
144+
"reset_modules_order": 'both',
145+
"reset_modules": (reset_servers,),
121146
}
122147

123148
autodoc_member_order = "bysource"
124149

125150

126151
# -- Options for HTML output -------------------------------------------------
152+
html_short_title = html_title = "PyDPF-Core"
127153
html_theme = "ansys_sphinx_theme"
128154
html_logo = pyansys_logo_black
129155
html_theme_options = {
130-
"github_url": "https://github.com/pyansys/DPF-Core",
156+
"github_url": "https://github.com/pyansys/pydpf-core",
131157
"show_prev_next": False,
132-
"logo_link": "https://dpfdocs.pyansys.com/" # navigate to the main page
158+
"show_breadcrumbs": True,
159+
"additional_breadcrumbs": [
160+
("PyAnsys", "https://docs.pyansys.com/"),
161+
],
133162
}
134163

135164

docs/source/user_guide/operators.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ You can create data sources in two ways:
126126

127127

128128
Because several other examples use the ``Model`` class, this example uses the
129-
``DataSources``class:
129+
``DataSources`` class:
130130

131131
.. code-block:: python
132132
@@ -168,7 +168,7 @@ can also be connected to work on a temporal subset:
168168
169169
Evaluate operators
170170
~~~~~~~~~~~~~~~~~~
171-
With all the required inputs assigned, you can output the :class:`ansys.dpf.core.fields_container`_
171+
With all the required inputs assigned, you can output the :class:`ansys.dpf.core.fields_container`
172172
class from the operator:
173173

174174
.. code-block:: python

examples/03-advanced/04-extrapolation_stress_3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
###############################################################################
7070
# Nodal stress result of integration points
7171
###############################################################################
72-
# The MAPLD command ``ERESX,NO``is used to copy directly the
72+
# The MAPLD command ``ERESX,NO`` is used to copy directly the
7373
# Gaussian (integration) points results to the nodes, instead of the
7474
# results at nodes or elements (which are interpolation of results at a
7575
# few gauss points).

examples/03-advanced/05-extrapolation_strain_2d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
###############################################################################
5454
# Extrapolate from integration points for elastic strain result
5555
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
56-
# This example uses the ``gauss_to_node_fc``operator to compute nodal component
56+
# This example uses the ``gauss_to_node_fc`` operator to compute nodal component
5757
# elastic strain results from the elastic strain at the integration points.
5858

5959
# Create elastic strain operator to get strain result of integration points

examples/03-advanced/10-asme_secviii_divtwo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
#
4242
# - ``alfasl`` = input("Introduce ``alfasl`` parameter from ASME\n")
4343
# - ``alfasl`` = float(alfasl)
44-
# -``m2`` = input("Introduce ``m2`` parameter from ASME\n")
44+
# - ``m2`` = input("Introduce ``m2`` parameter from ASME\n")
4545
# - ``m2`` = float(m2)
4646
#
4747
# For this exercise, ``alfasl`` = 2.2 and ``m2`` = .288, which is the same

examples/08-averaging/00-compute_and_average.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ def average_then_compute_von_mises(analysis):
146146
# Plot the results
147147
# ~~~~~~~~~~~~~~~~
148148
# Plot both von Mises stress fields side by side to compare them.
149-
# - The first plot displays the results when the equivalent stresses are calculated
150-
# first.
149+
# - The first plot displays the results when the equivalent stresses are calculated first.
151150
# - The second plot shows the results when the averaging is done first.
152151
#
153152

examples/08-averaging/README.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. _averaging_examples
1+
.. _averaging_examples:
22

33
Averaging examples
44
==================

0 commit comments

Comments
 (0)