This section explains how to resolve the most common issues encountered with pydpf-core. It also includes suggestions for improving scripts.

Using the Server

Starting DPF Server

While using the DPF-Python API to start the server with start_local_server() or while starting the server manually (with or Ans.Dpf.Grpc.bat), a Python error might occur: “TimeoutError: Server did not start in 10 seconds”. This kind of error might mean that the server or its dependencies were not found. Ensure that the environment variable AWP_ROOT{VER} is set, where VER=212, 221, ….

Connecting to DPF Server

If an issue appears while using the pydpf-core API to connect to an initialized server with connect_to_server(), ensure that the IP address and port number that are set as parameters are applicable for a DPF server started on the network.

Importing pydpf-core module

Assume that you are importing the pydpf-core module:

from ansys.dpf import core as dpf

If an error lists missing modules, see the compatibility paragraph of _ref_getting_started. The module ansys.grpc.dpf should always be synchronized with its server version.

Performance Issues

Getting and Setting a Field’s Data

Accessing or modifying field data Field entity by entity can be slow if the field’s size is large or if the server is far from the Python client. To improve performance, use as_local_field() in a context manager. An example can be found in _ref_use_local_data_example.

Slow Autocompletion in Notebooks

Autocompletion in Jupyter notebook can sometimes be slow for large models. The interpreter might evaluate getters of some properties when the tab key is pressed. To disable this capability use disable_interpreter_properties_evaluation():

from ansys.dpf import core as dpf