diff --git a/ansys/dpf/core/server.py b/ansys/dpf/core/server.py index fb899b28ed7..2a10e579d37 100644 --- a/ansys/dpf/core/server.py +++ b/ansys/dpf/core/server.py @@ -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: @@ -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. " + # 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}" + # )