Skip to content

Commit 305bcdd

Browse files
committed
Last improvements to documentation for 0.3.0 (#316)
* Fix Vale * Fix Vale * Bump to vimtor/[email protected] * Fix Vale * Fix docs artifact upload * Update documentation * Improve API documentation. * Typo in examples/__init__.py
1 parent 6bd968c commit 305bcdd

38 files changed

+297
-184
lines changed

.github/workflows/docs.yml

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ on:
3232
required: true
3333
type: string
3434
default: ''
35+
generate_pdf:
36+
description: "Whether to build the PDF doc"
37+
type: string
38+
default: 'True'
39+
debug:
40+
description: "Debug verbose mode"
41+
type: string
42+
default: 'True'
3543
# Can be called manually
3644
workflow_dispatch:
3745
inputs:
@@ -60,6 +68,10 @@ on:
6068
required: false
6169
type: string
6270
default: ''
71+
generate_pdf:
72+
description: "Whether to build the PDF doc"
73+
type: string
74+
default: 'True'
6375

6476
env:
6577
PACKAGE_NAME: ansys-dpf-post
@@ -169,21 +181,23 @@ jobs:
169181
- name: "Upload Documentation Build log"
170182
uses: actions/[email protected]
171183
with:
172-
name: doc-${{inputs.PACKAGE_NAME}}-log
184+
name: doc-${{env.PACKAGE_NAME}}-log
173185
path: docs/*.txt
174-
if: inputs.debug == 'false'
186+
if: always()
175187

176188
- name: "Zip HTML Documentation"
177-
uses: vimtor/action-zip@v1
189+
uses: vimtor/action-zip@v1.1
178190
with:
179191
files: docs/build/html
180-
dest: HTML-doc-${{inputs.PACKAGE_NAME}}.zip
192+
dest: HTML-doc-${{env.PACKAGE_NAME}}.zip
193+
if: always()
181194

182195
- name: "Upload HTML Documentation"
183196
uses: actions/upload-artifact@v3
184197
with:
185-
name: HTML-doc-${{inputs.PACKAGE_NAME}}
186-
path: HTML-doc-${{inputs.PACKAGE_NAME}}.zip
198+
name: HTML-doc-${{env.PACKAGE_NAME}}
199+
path: HTML-doc-${{env.PACKAGE_NAME}}.zip
200+
if: always()
187201

188202
- name: "Find PDF Documentation"
189203
shell: bash
@@ -197,18 +211,18 @@ jobs:
197211
echo "Found PDF doc: ${files[0]}"
198212
199213
- name: "Zip PDF Documentation"
200-
uses: vimtor/action-zip@v1
214+
uses: vimtor/action-zip@v1.1
201215
if: ${{ inputs.generate_pdf == 'true' }}
202216
with:
203217
files: docs/build/latex/${{ steps.pdf.outputs.PDF_file }}
204-
dest: PDF-doc-${{inputs.PACKAGE_NAME}}.zip
218+
dest: PDF-doc-${{env.PACKAGE_NAME}}.zip
205219

206220
- name: "Upload PDF Documentation"
207221
uses: actions/[email protected]
208222
if: inputs.generate_pdf == 'true'
209223
with:
210-
name: PDF-doc-${{inputs.PACKAGE_NAME}}
211-
path: PDF-doc-${{inputs.PACKAGE_NAME}}.zip
224+
name: PDF-doc-${{env.PACKAGE_NAME}}
225+
path: PDF-doc-${{env.PACKAGE_NAME}}.zip
212226

213227
- name: "Kill all servers"
214228
uses: pyansys/pydpf-actions/[email protected]

README.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# DPF-Post - Ansys Data Post-Processing Framework
1+
# PyDPF-Post - Ansys Data Post-Processing Framework
22
[![PyAnsys](https://img.shields.io/badge/Py-Ansys-ffc107.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAABDklEQVQ4jWNgoDfg5mD8vE7q/3bpVyskbW0sMRUwofHD7Dh5OBkZGBgW7/3W2tZpa2tLQEOyOzeEsfumlK2tbVpaGj4N6jIs1lpsDAwMJ278sveMY2BgCA0NFRISwqkhyQ1q/Nyd3zg4OBgYGNjZ2ePi4rB5loGBhZnhxTLJ/9ulv26Q4uVk1NXV/f///////69du4Zdg78lx//t0v+3S88rFISInD59GqIH2esIJ8G9O2/XVwhjzpw5EAam1xkkBJn/bJX+v1365hxxuCAfH9+3b9/+////48cPuNehNsS7cDEzMTAwMMzb+Q2u4dOnT2vWrMHu9ZtzxP9vl/69RVpCkBlZ3N7enoDXBwEAAA+YYitOilMVAAAAAElFTkSuQmCC)](https://docs.pyansys.com/)
33
[![Python](https://img.shields.io/pypi/pyversions/ansys-dpf-post?logo=pypi)](https://pypi.org/project/ansys-dpf-post/)
44
[![pypi](https://badge.fury.io/py/ansys-dpf-post.svg?logo=python&logoColor=white)](https://pypi.org/project/ansys-dpf-post)
@@ -17,15 +17,13 @@ be found by visiting [PyDPF-Core
1717
GitHub](https://github.com/pyansys/pydpf-core). Use ``ansys-dpf-core`` for
1818
building more advanced and customized workflows using Ansys DPF.
1919

20-
2120
## Documentation
2221

23-
Visit the [DPF-Post Documentation](https://postdocs.pyansys.com) for a
22+
Visit the [PyDPF-Post Documentation](https://postdocs.pyansys.com) for a
2423
detailed description of the package, or see the [Examples
2524
Gallery](https://postdocs.pyansys.com/examples/index.html) for more
2625
detailed examples.
2726

28-
2927
## Installation
3028

3129
Install this repository with:
@@ -42,11 +40,10 @@ cd pydpf-post
4240
pip install . --user
4341
```
4442

45-
4643
## Brief Demo
4744

48-
Provided you have ANSYS 2023 R1 installed, a DPF server will start
49-
automatically once you start using pyDPF-Post.
45+
Provided you have ANSYS 2023 R1 installed, a DPF server starts
46+
automatically once you start using PyDPF-Post.
5047
Loading a simulation to extract and post-process results:
5148

5249
```pycon
@@ -56,6 +53,7 @@ Loading a simulation to extract and post-process results:
5653
>>> displacement = simulation.displacement()
5754
>>> print(displacement)
5855
```
56+
```pycon
5957
results U
6058
set_id 3
6159
node comp
@@ -66,7 +64,7 @@ Loading a simulation to extract and post-process results:
6664
Y 1.44e-03
6765
Z 5.31e-06
6866
...
69-
67+
```
7068
```pycon
7169
>>> displacement.plot()
7270
```
@@ -89,7 +87,6 @@ tools:
8987
```
9088
![Example Stress plot Crankshaft](https://github.com/pyansys/dpf-post/raw/master/docs/source/images/crankshaft_stress.png)
9189

92-
9390
## License
9491

9592
``PyDPF-Post`` is licensed under the MIT license. For more information, see the

docs/source/conf.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@
217217
(
218218
master_doc,
219219
"PyDPF-Post.tex",
220-
"PyAnsys DPF-Post Documentation",
220+
"PyAnsys PyDPF-Post Documentation",
221221
author,
222222
"manual",
223223
),
@@ -228,7 +228,9 @@
228228

229229
# One entry per manual page. List of tuples
230230
# (source start file, name, description, authors, manual section).
231-
man_pages = [(master_doc, "PyDPF-Post", "PyAnsys DPF-Post Documentation", [author], 1)]
231+
man_pages = [
232+
(master_doc, "PyDPF-Post", "PyAnsys PyDPF-Post Documentation", [author], 1)
233+
]
232234

233235

234236
# -- Options for Texinfo output ----------------------------------------------
@@ -240,7 +242,7 @@
240242
(
241243
master_doc,
242244
"PyDPF-Post",
243-
"PyAnsys DPF-Post Documentation",
245+
"PyAnsys PyDPF-Post Documentation",
244246
author,
245247
"pyansys",
246248
"",

docs/source/contributing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ development mode, run:
2525
Post issues
2626
-----------
2727

28-
Use the `PyDPF-Post Issues <https://github.com/pyansys/DPF-Post/issues>`_
28+
Use the `PyDPF-Post Issues <https://github.com/pyansys/pydpf-post/issues>`_
2929
page to submit questions, report bugs, and request new features.
3030

3131
To reach the PyAnsys support team, email `[email protected] <[email protected]>`_.
3232

3333
View documentation
3434
------------------
3535
Documentation for the latest stable release of PyDPF-Post is hosted at
36-
`PyDPF Documentation <https://postdocs.pyansys.com/>_.
36+
`PyDPF Documentation <https://post.docs.pyansys.com/>`_.
3737

docs/source/getting_started/index.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ Getting started
66

77
To use the PyDPF-Post API, you must have PyDPF-Core installed. Because you need to
88
use a native DPF server, you must also have a local installation of Ansys 2021 R1
9-
or later. For more information on getting a licensed copy of Ansys, visit the
9+
or later or of the standalone DPF Server.
10+
For more information on getting a licensed copy of Ansys, visit the
1011
`Ansys website <https://www.ansys.com/>`_.
12+
For more information on getting the standalone DPF Server, visit the
13+
`PyDPF-Core documentation <https://dpf.docs.pyansys.com/dev/user_guide/getting_started_with_dpf_server.html>`_.
1114

1215

1316
.. toctree::

docs/source/getting_started/install.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ and unzip it to the same local directory before running the preceding command ag
5050
Install in development mode
5151
---------------------------
5252

53-
If you want to edit and potentially contribute to DPF-Post,
53+
If you want to edit and potentially contribute to PyDPF-Post,
5454
clone the repository and install it using ``pip`` with the ``-e``
5555
development flag:
5656

@@ -66,5 +66,5 @@ Run the following Python code to verify your PyDPF-Post installation:
6666
6767
from ansys.dpf import post
6868
from ansys.dpf.post import examples
69-
solution = post.load_solution(examples.simple_bar)
70-
print(solution)
69+
simulation = post.load_simulation(examples.simple_bar)
70+
print(simulation)
213 KB
Loading

docs/source/index.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ The Python `ansys-dpf-post` package provides a high level, physics oriented API
1010
Loading a simulation (defined by its result files) allows you to extract simulation metadata as well
1111
as results and apply postprocessing operations on it.
1212

13-
This module leverages the PyDPF-Core project's ``ansys-dpf-core`` package and can
14-
be found by visiting [PyDPF-Core GitHub](https://github.com/pyansys/pydpf-core).
13+
This module leverages the PyDPF-Core project's ``ansys-dpf-core`` package which can
14+
be found by visiting `PyDPF-Core GitHub <https://github.com/pyansys/pydpf-core>`_.
1515
Use ``ansys-dpf-core`` for building more advanced and customized workflows using Ansys DPF.
1616

1717

1818
Brief demo
1919
~~~~~~~~~~
2020

21-
Provided you have ANSYS 2023 R1 installed, a DPF server will start
21+
Provided you have Ansys 2023 R1 installed, a DPF server starts
2222
automatically once you start using PyDPF-Post.
2323
Loading a simulation for a MAPDL result file to extract and post-process results:
2424

@@ -87,7 +87,7 @@ Key features
8787

8888
PyDPF-Post is based on DPF, whose data framework localizes loading and
8989
postprocessing on the DPF server, enabling rapid postprocessing workflows
90-
because they are written in C and FORTRAN. Because DPF-Post presents results
90+
because they are written in C and FORTRAN. Because PyDPF-Post presents results
9191
in a Pythonic manner, you can rapidly develop simple or complex postprocessing
9292
scripts.
9393

docs/source/user_guide/accessing_file_metadata.rst

Lines changed: 56 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,67 +4,93 @@
44
Browse result metadata
55
**********************
66

7-
In addition to the :class:`DpfSolution <ansys.dpf.post.dpf_solution.DpfSolution>`
7+
In addition to the :class:`Simulation <ansys.dpf.post.simulation.Simulation>`
88
object being the entry point for browsing the contents of a result file, it provides
99
important metadata, such as the analysis type and the available results.
1010

1111
Here is how you browse result metadata:
1212

1313
.. code:: python
1414
15-
Instantiate the solution object
15+
Instantiate the simulation object
1616
1717
>>> from ansys.dpf import post
1818
>>> from ansys.dpf.post import examples
19-
>>> solution = post.load_solution(examples.multishells_rst)
19+
>>> simulation = post.load_simulation(examples.multishells_rst)
2020
2121
Browse result metadata
2222
23-
>>> result_info = solution.get_result_info()
24-
>>> print(result_info)
23+
>>> print(simulation)
24+
Static Mechanical Simulation.
25+
26+
27+
Data Sources
28+
------------------------------
29+
DPF DataSources:
30+
Result files:
31+
result key: rst and path: d:\ansysdev\sandbox\pydpf-core\src\ansys\dpf\core\examples\model_with_ns.rst
32+
Secondary files:
33+
34+
35+
DPF Model
36+
------------------------------
2537
Static analysis
26-
Unit system: Metric (m, kg, N, s, V, A)
27-
Physics Type: Mecanic
38+
Unit system: MKS: m, kg, N, s, V, A, degC
39+
Physics Type: Mechanical
2840
Available results:
29-
- displacement
30-
- force
31-
- stress
32-
- volume
33-
- energy_stiffness_matrix
34-
- hourglass_energy
35-
- thermal_dissipation_energy
36-
- kinetic_energy
37-
- co_energy
38-
- incremental_energy
39-
- strain
40-
- temperature
41-
42-
43-
DPF-Post supports four different analysis types:
41+
- displacement: Nodal Displacement
42+
- reaction_force: Nodal Force
43+
- stress: ElementalNodal Stress
44+
- elemental_volume: Elemental Volume
45+
- stiffness_matrix_energy: Elemental Energy-stiffness matrix
46+
- artificial_hourglass_energy: Elemental Hourglass Energy
47+
- thermal_dissipation_energy: Elemental thermal dissipation energy
48+
- kinetic_energy: Elemental Kinetic Energy
49+
- co_energy: Elemental co-energy
50+
- incremental_energy: Elemental incremental energy
51+
- elastic_strain: ElementalNodal Strain
52+
- structural_temperature: ElementalNodal Temperature
53+
------------------------------
54+
DPF Meshed Region:
55+
7079 nodes
56+
4220 elements
57+
Unit: m
58+
With solid (3D) elements, shell (2D) elements, shell (3D) elements
59+
------------------------------
60+
DPF Time/Freq Support:
61+
Number of sets: 1
62+
Cumulative Time (s) LoadStep Substep
63+
1 1.000000 1 1
64+
65+
66+
PyDPF-Post supports four different analysis types for mechanical results:
4467

4568
* Static analysis
4669
* Modal analysis
4770
* Harmonic analysis
4871
* Transient analysis
4972

73+
The legacy Solution object also supports thermal and electrical results.
74+
5075
Mesh
5176
----
52-
From the ``Solution`` object, you can also access the mesh:
77+
From the ``Simulation`` object, you can also access the mesh:
5378

5479
.. code:: python
5580
56-
Instantiate the solution object
81+
Instantiate the simulation object
5782
5883
>>> from ansys.dpf import post
5984
>>> from ansys.dpf.post import examples
60-
>>> solution = post.load_solution(examples.multishells_rst)
85+
>>> simulation = post.load_simulation(examples.multishells_rst)
6186
6287
Access the mesh
6388
64-
>>> mesh = solution.mesh
89+
>>> mesh = simulation.mesh
6590
>>> print(mesh)
66-
Meshed Region
67-
7079 nodes
68-
4220 elements
69-
Unit: m
91+
DPF Mesh:
92+
7079 nodes
93+
4220 elements
94+
Unit: m
95+
With solid (3D) elements, shell (2D) elements, shell (3D) elements
7096

0 commit comments

Comments
 (0)