Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions ansys/dpf/core/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,8 @@ def read_stderr():
pass
errstr = "\n".join(errors)
if "Only one usage of each socket address" in errstr:
raise errors.InvalidPortError(f"Port {port} in use")
from ansys.dpf.core.errors import InvalidPortError
raise InvalidPortError(f"Port {port} in use")
raise RuntimeError(errstr)

if len(docker_id) > 0:
Expand All @@ -685,11 +686,25 @@ def check_ansys_grpc_dpf_version(server, timeout=10.):
server_version = server.version
right_grpc_module_version = server_to_ansys_grpc_dpf_version.get(server_version, None)
if right_grpc_module_version and right_grpc_module_version != grpc_module_version:
raise ImportWarning(f"2022R1 Ansys unified install is available. "
f"To use DPF server from Ansys "
f"{server_to_ansys_version.get(server_version, 'Unknown')}"
f" (dpf.SERVER.version=='{server_version}'), "
f"install version {right_grpc_module_version} of ansys-grpc-dpf"
compatibility_link = (f"https://dpfdocs.pyansys.com/getting_started/"
f"index.html#client-server-compatibility")
raise ImportWarning(f"An incompatibility has been detected between the DPF server version "
f"({server_version} "
f"from Ansys {server_to_ansys_version.get(server_version, 'Unknown')})"
f" and the ansys-grpc-dpf version installed ({grpc_module_version})."
f" Please consider using the latest DPF server available in the "
f"2022R1 Ansys unified install.\n"
f"To follow the compatibility guidelines given in "
f"{compatibility_link} while still using DPF server {server_version}, "
f"please install version {right_grpc_module_version} of ansys-grpc-dpf"
f" with the command: \n"
f" pip install ansys-grpc-dpf=={right_grpc_module_version}"
)
# raise ImportWarning(f"2022R1 Ansys unified install is available. "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PProfizi the goal of this message is also to inform the user that a newer Ansys version is available and can be installed. This is important to mention

Copy link
Contributor Author

@PProfizi PProfizi Apr 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rlagha , ok, noted, I modified the message to:

An incompatibility has been detected between the DPF server version (2.0 from Ansys 2021R2) and the ansys-grpc-dpf version installed (0.4.0). Please consider using the latest DPF server available in the 2022R1 Ansys unified install.
To follow the compatibility guidelines given in https://dpfdocs.pyansys.com/getting_started/index.html#client-server-compatibility while still using DPF server 2.0, please install version 0.3.0 of ansys-grpc-dpf with the command:
pip install ansys-grpc-dpf==0.3.0

# f"To use DPF server from Ansys "
# f"{server_to_ansys_version.get(server_version, 'Unknown')}"
# f" (dpf.SERVER.version=='{server_version}'), "
# f"install version {right_grpc_module_version} of ansys-grpc-dpf"
# f" with the command: \n"
# f" pip install ansys-grpc-dpf=={right_grpc_module_version}"
# )