|
| 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