Skip to content

Commit b16c2b4

Browse files
authored
Doc/add troubleshooting (#109)
1 parent feb6025 commit b16c2b4

File tree

3 files changed

+63
-0
lines changed

3 files changed

+63
-0
lines changed

docs/source/getting_started/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _ref_getting_started:
2+
13
===============
24
Getting Started
35
===============

docs/source/user_guide/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ Additionally, :ref:`user_guide_plotting` describes how to plot results via PyVis
2424
operators
2525
fields_container
2626
plotting
27+
troubleshooting
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
.. _user_guide_troubleshooting:
2+
3+
===============
4+
Troubleshooting
5+
===============
6+
This section explains how to resolve the most common issues encountered with ``pydpf-core``.
7+
It also includes suggestions for improving scripts.
8+
9+
Using the Server
10+
----------------
11+
12+
Starting DPF Server
13+
~~~~~~~~~~~~~~~~~~~
14+
While using the DPF-Python API to start the server with :py:meth:`start_local_server()
15+
<ansys.dpf.core.server.start_local_server>` or while starting the server manually (with ``Ans.Dpf.Grpc.sh``
16+
or ``Ans.Dpf.Grpc.bat``), a Python error might occur: "TimeoutError: Server did not start in 10 seconds".
17+
This kind of error might mean that the server or its dependencies were not found. Ensure that
18+
the environment variable ``AWP_ROOT{VER}`` is set, where VER=212, 221, ....
19+
20+
Connecting to DPF Server
21+
~~~~~~~~~~~~~~~~~~~~~~~~
22+
If an issue appears while using the pydpf-core API to connect to an initialized server with :py:meth:`connect_to_server()
23+
<ansys.dpf.core.server.connect_to_server>`, ensure that the IP address and port number that are set as parameters
24+
are applicable for a DPF server started on the network.
25+
26+
Importing pydpf-core module
27+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
28+
Assume that you are importing the pydpf-core module:
29+
30+
.. code-block:: default
31+
32+
from ansys.dpf import core as dpf
33+
34+
If an error lists missing modules, see the compatibility paragraph of :ref:`_ref_getting_started`.
35+
The module `ansys.grpc.dpf <https://pypi.org/project/ansys-grpc-dpf/>`_ should always be synchronized with its server
36+
version.
37+
38+
39+
Performance Issues
40+
------------------
41+
42+
Getting and Setting a Field's Data
43+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44+
Accessing or modifying field data :py:class:`Field<ansys.dpf.core.field.Field>` entity by entity can
45+
be slow if the field's size is large or if the server is far from the Python client. To improve performance,
46+
use :py:meth:`as_local_field()<ansys.dpf.core.field.Field.as_local_field>` in a context manager.
47+
An example can be found in :ref:`_ref_use_local_data_example`.
48+
49+
Slow Autocompletion in Notebooks
50+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
51+
Autocompletion in Jupyter notebook can sometimes be slow for large models. The interpreter might
52+
evaluate getters of some properties when the tab key is pressed. To disable this capability use
53+
:py:meth:`disable_interpreter_properties_evaluation()<ansys.dpf.core.settings.disable_interpreter_properties_evaluation>`:
54+
55+
.. code-block:: default
56+
57+
from ansys.dpf import core as dpf
58+
dpf.settings.disable_interpreter_properties_evaluation()
59+
60+

0 commit comments

Comments
 (0)