Skip to content

Commit cc7c17d

Browse files
Various improvements to streamline example code (#350)
* Add self contained example that builds an ACP model from a cdb file that just contains the mesh. * Add workflow helper to simplify file transfer operations * Move to_pyvista function one level lower so that the user does not have to specify the component enums. *Add tree printer closes #343 closes #232
1 parent 62ec7ae commit cc7c17d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1874
-928
lines changed

.github/workflows/ci_cd.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,11 @@ jobs:
270270
- name: Build HTML
271271
run: |
272272
xvfb-run poetry run make -C doc html SPHINXOPTS="-W --keep-going -v"
273+
env:
274+
PYMAPDL_PORT: "50557"
275+
PYMAPDL_START_INSTANCE: "FALSE"
276+
PYDPF_COMPOSITES_DOCKER_CONTAINER_PORT: "50558"
277+
273278

274279
- name: Stop and clean up MAPDL and DPF servers
275280
run: |

README.rst

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -153,19 +153,9 @@ You will need to follow these steps:
153153
154154
poetry shell
155155
156-
.. TODO: If we add tox, add instructions on its use here.
157-
158-
.. 6. Verify your development installation by running:
159-
160-
.. .. code-block:: bash
161-
162-
.. tox
163-
164156
Testing
165157
^^^^^^^
166158

167-
.. TODO: If we add tox, add instructions on its use here.
168-
169159
The PyACP test suite uses `pytest`_. You can run it with
170160

171161
.. code-block:: bash
@@ -210,16 +200,9 @@ need to create a commit without running the hooks, you can skip them with ``git
210200

211201
Documentation
212202
^^^^^^^^^^^^^
213-
214-
To build the documentation, DPF Composites and MAPDL servers need to be running:
215-
216-
.. code-block:: bash
217-
218-
docker-compose -f docker-compose/docker-compose-extras.yaml up -d
219-
220-
In addition, the PyACP server needs to be configured via ``ansys-launcher``, see `Launching ACP <launching_server>`_ above.
221-
222-
It can then be built using `Sphinx`_.
203+
Before generating the documentation, configure the PyACP server via the
204+
``ansys-launcher``, see `Launching ACP <launching_server>`_ above.
205+
If Ansys is installed the examples can directly built with `Sphinx`_.
223206

224207
On Linux & MacOS:
225208

@@ -235,6 +218,20 @@ On Windows:
235218
236219
The generated HTML files can be viewed with the browser of your choice.
237220

221+
Alternatively you can build the documentation by starting a mapdl and pydpf-composites docker
222+
container. First ensure that you have accepted the DPF Preview License Agreement by setting the
223+
ANSYS_DPF_ACCEPT_LA environment variable to Y
224+
(see `DPF Preview License Agreement <https://dpf.docs.pyansys.com/version/stable/user_guide/getting_started_with_dpf_server.html#dpf-preview-license-agreement>`_
225+
). In addition the ANSYSLMD_LICENSE_FILE environment variable needs be set to a
226+
valid license server (e.g [email protected]). Then start the docker containers with:
227+
228+
.. code-block:: bash
229+
230+
docker-compose -f docker-compose/docker-compose-extras.yaml up -d
231+
232+
Then build the documentation with the `Sphinx`_ commands mentioned above.
233+
234+
238235
Distribution
239236
^^^^^^^^^^^^
240237

@@ -264,4 +261,3 @@ License
264261
.. _pre-commit: https://pre-commit.com/
265262
.. _pytest: https://docs.pytest.org/en/stable/
266263
.. _Sphinx: https://www.sphinx-doc.org/en/master/
267-
.. _tox: https://tox.wiki/

doc/source/api/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ and attributes.
1515
linked_object_definitions
1616
material_property_sets
1717
other_types
18+
workflow

doc/source/api/tree_objects.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,5 @@ ACP objects
3434
ProductionPly
3535
AnalysisPly
3636
Sensor
37+
ScalarData
38+
VectorData

doc/source/api/workflow.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Workflow
2+
--------
3+
4+
.. currentmodule:: ansys.acp.core
5+
6+
.. autosummary::
7+
:toctree: _autosummary
8+
9+
ACPWorkflow
10+
get_composite_post_processing_files
11+
get_model_tree
12+
get_dpf_unit_system
13+
print_model
14+
15+
16+

doc/source/examples/index.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,3 @@ Examples
66

77
.. include:: gallery_examples/index.rst
88
:start-line: 2
9-
10-
:doc:`./others/local_pyacp_executable` demonstrates running the
11-
PyACP server from a local executable instead of in a Docker container

0 commit comments

Comments
 (0)