Skip to content

Commit

Permalink
feat: Changes to support Fluent 25.2 dev
Browse files Browse the repository at this point in the history
  • Loading branch information
mkundu1 committed Nov 12, 2024
1 parent 59fef1b commit 35fbd16
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions devel/update_settings_builtin_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
"""
Script to update the settings_builtin_data.py file with the new Fluent version.
Usage: python devel/update_settings_builtin_data.py --version 252
"""

import argparse
from pathlib import Path

from ansys.fluent.core.utils.fluent_version import FluentVersion

parser = argparse.ArgumentParser()
parser.add_argument("--version", type=str, required=True)
args = parser.parse_args()
new_version = FluentVersion(args.version).name
index = FluentVersion._member_names_.index(new_version)
previous_version = FluentVersion._member_names_[index + 1]

file_path = (
Path(__file__).parent.parent
/ "src"
/ "ansys"
/ "fluent"
/ "core"
/ "solver"
/ "settings_builtin_data.py"
).resolve()
lines = []

with open(file_path, "r") as file:
for line in file:
if previous_version in line:
new_line = line.replace(previous_version, new_version)
lines.append(new_line)
lines.append(line)

with open(file_path, "w") as file:
file.writelines(lines)

0 comments on commit 35fbd16

Please sign in to comment.