diff --git a/src/ansys/dpf/core/result_info.py b/src/ansys/dpf/core/result_info.py index 6db4a936d2..b950ac32d2 100644 --- a/src/ansys/dpf/core/result_info.py +++ b/src/ansys/dpf/core/result_info.py @@ -144,9 +144,12 @@ def __str__(self): return txt except Exception as e: raise e - from ansys.dpf.core.core import _description - return _description(self._internal_obj, self._server) + @property + def _description(self): + from ansys.dpf.core.core import _description + + return _description(self._internal_obj, self._server) @property def _names(self): diff --git a/src/ansys/dpf/core/server_types.py b/src/ansys/dpf/core/server_types.py index fc100c0c70..1f888d702b 100644 --- a/src/ansys/dpf/core/server_types.py +++ b/src/ansys/dpf/core/server_types.py @@ -678,6 +678,8 @@ def __init__( self._grpc_client_path = load_api.load_grpc_client(ansys_path=ansys_path) self._own_process = launch_server self._local_server = False + self._os = None + self._version = None address = f"{ip}:{port}" @@ -735,21 +737,24 @@ def _check_first_call(self, num_connection_tryouts): @property def version(self): - from ansys.dpf.gate import data_processing_capi, integral_types + if not self._version: + from ansys.dpf.gate import data_processing_capi, integral_types - api = data_processing_capi.DataProcessingCAPI - major = integral_types.MutableInt32() - minor = integral_types.MutableInt32() - api.data_processing_get_server_version_on_client(self.client, major, minor) - out = str(int(major)) + "." + str(int(minor)) - return out + api = data_processing_capi.DataProcessingCAPI + major = integral_types.MutableInt32() + minor = integral_types.MutableInt32() + api.data_processing_get_server_version_on_client(self.client, major, minor) + self._version = str(int(major)) + "." + str(int(minor)) + return self._version @property def os(self): - from ansys.dpf.gate import data_processing_capi + if not self._os: + from ansys.dpf.gate import data_processing_capi - api = data_processing_capi.DataProcessingCAPI - return api.data_processing_get_os_on_client(self.client) + api = data_processing_capi.DataProcessingCAPI + self._os = api.data_processing_get_os_on_client(self.client) + return self._os def _create_shutdown_funcs(self): from ansys.dpf.gate import data_processing_capi