-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: App utilities gRPC services (#3552)
* feat: App utilities * feat: App utilities * feat: move to session.py * feat: use service * feat: use service 1 * feat: make private * use match * version * set black hook to 310 * remove version * version usage update * build info update 1 * error fix * api upgrade * feat: correct a typo * update handling * update handling 1 * working fine * api version 0.3.30 * use old and new * update 1 * update interface * update interface fix * update interface fix 1 * update interface fix 2 * update interface fix 3 * Revert "update interface fix 3" This reverts commit fd6c79e. * update session.py * pass callable * pass callable 1 * pass callable 1 * test fix 1 * test fix 3 * test fix 4 * test fix 4
- Loading branch information
Showing
15 changed files
with
514 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,21 @@ | ||
"""Module to write Fluent version information.""" | ||
|
||
from ansys.fluent.core import CODEGEN_OUTDIR, launch_fluent | ||
from ansys.fluent.core.utils.fluent_version import get_version_for_file_name | ||
from ansys.fluent.core import CODEGEN_OUTDIR, FluentVersion, launch_fluent | ||
|
||
|
||
def print_fluent_version(version: str, scheme_eval): | ||
def print_fluent_version(app_utilities): | ||
"""Write Fluent version information to file.""" | ||
version = FluentVersion(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: | ||
f.write(f'FLUENT_VERSION = "{version}"\n') | ||
f.write(f'FLUENT_BUILD_TIME = "{scheme_eval("(inquire-build-time)")}"\n') | ||
f.write(f'FLUENT_BUILD_ID = "{scheme_eval("(inquire-build-id)")}"\n') | ||
f.write(f'FLUENT_REVISION = "{scheme_eval("(inquire-src-vcs-id)")}"\n') | ||
f.write(f'FLUENT_BRANCH = "{scheme_eval("(inquire-src-vcs-branch)")}"\n') | ||
|
||
|
||
def generate(version: str, scheme_eval): | ||
"""Write Fluent version information.""" | ||
print_fluent_version(version, scheme_eval) | ||
f.write(f'FLUENT_BUILD_TIME = "{build_info["build_time"]}"\n') | ||
f.write(f'FLUENT_BUILD_ID = "{build_info["build_id"]}"\n') | ||
f.write(f'FLUENT_REVISION = "{build_info["vcs_revision"]}"\n') | ||
f.write(f'FLUENT_BRANCH = "{build_info["vcs_branch"]}"\n') | ||
|
||
|
||
if __name__ == "__main__": | ||
solver = launch_fluent() | ||
version = get_version_for_file_name(session=solver) | ||
generate(version, solver.scheme_eval.scheme_eval) | ||
print_fluent_version(solver._app_utilities) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.