From fd6c79e9aa6c42ee541451b1e9a214bfcaf2c89f Mon Sep 17 00:00:00 2001 From: Harshal Pohekar Date: Tue, 17 Dec 2024 21:21:12 +0530 Subject: [PATCH] update interface fix 3 --- src/ansys/fluent/core/codegen/print_fluent_version.py | 4 ++-- src/ansys/fluent/core/services/app_utilities.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/ansys/fluent/core/codegen/print_fluent_version.py b/src/ansys/fluent/core/codegen/print_fluent_version.py index 3e6b5aac7ae..5383c004f37 100644 --- a/src/ansys/fluent/core/codegen/print_fluent_version.py +++ b/src/ansys/fluent/core/codegen/print_fluent_version.py @@ -1,11 +1,11 @@ """Module to write Fluent version information.""" -from ansys.fluent.core import CODEGEN_OUTDIR, FluentVersion, launch_fluent +from ansys.fluent.core import CODEGEN_OUTDIR, launch_fluent def print_fluent_version(app_utilities): """Write Fluent version information to file.""" - version = FluentVersion(app_utilities.get_product_version()).number + version = app_utilities.get_product_version().number build_info = app_utilities.get_build_info() version_file = (CODEGEN_OUTDIR / f"fluent_version_{version}.py").resolve() with open(version_file, "w", encoding="utf8") as f: diff --git a/src/ansys/fluent/core/services/app_utilities.py b/src/ansys/fluent/core/services/app_utilities.py index d4953fd2127..55e9ddc4925 100644 --- a/src/ansys/fluent/core/services/app_utilities.py +++ b/src/ansys/fluent/core/services/app_utilities.py @@ -132,7 +132,9 @@ def __init__(self, scheme_eval): def get_product_version(self) -> str: """Get product version.""" - return self.scheme_eval.version + import ansys.fluent.core as pyfluent + + return pyfluent.FluentVersion(self.scheme_eval.version) def get_build_info(self) -> dict: """Get build info.""" @@ -281,9 +283,13 @@ def __init__(self, service: AppUtilitiesService): def get_product_version(self) -> str: """Get product version.""" + import ansys.fluent.core as pyfluent + request = AppUtilitiesProtoModule.GetProductVersionRequest() response = self.service.get_product_version(request) - return f"{response.major}.{response.minor}.{response.patch}" + return pyfluent.FluentVersion( + f"{response.major}.{response.minor}.{response.patch}" + ) def get_build_info(self) -> dict: """Get build info."""