From 291041094dce4f72a3f2fdb1b6b4f047495c100f Mon Sep 17 00:00:00 2001 From: hpohekar Date: Thu, 5 Jun 2025 17:26:46 +0530 Subject: [PATCH 1/5] refactor: Rename meshing_rule_file_names to datamodel_file_name_map [skip tests] --- src/ansys/fluent/core/codegen/datamodelgen.py | 4 ++-- src/ansys/fluent/core/session_shared.py | 4 ++-- tests/test_codegen.py | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ansys/fluent/core/codegen/datamodelgen.py b/src/ansys/fluent/core/codegen/datamodelgen.py index aa787889e53a..43b16b4f28ed 100644 --- a/src/ansys/fluent/core/codegen/datamodelgen.py +++ b/src/ansys/fluent/core/codegen/datamodelgen.py @@ -179,7 +179,7 @@ def _build_command_query_docstring( return doc.getvalue() -meshing_rule_file_names = { +datamodel_file_name_map = { "workflow": "workflow", "meshing": "meshing", "PartManagement": "part_management", @@ -213,7 +213,7 @@ def __init__( datamodel_dir = (pyfluent.CODEGEN_OUTDIR / f"datamodel_{version}").resolve() datamodel_dir.mkdir(exist_ok=True) self.file_name = ( - datamodel_dir / f"{meshing_rule_file_names[rules_save_name]}.py" + datamodel_dir / f"{datamodel_file_name_map[rules_save_name]}.py" ).resolve() if rules == "MeshingUtilities": self.stub_file = (datamodel_dir / "meshing_utilities.pyi").resolve() diff --git a/src/ansys/fluent/core/session_shared.py b/src/ansys/fluent/core/session_shared.py index 76dc92120fae..63885f28806b 100644 --- a/src/ansys/fluent/core/session_shared.py +++ b/src/ansys/fluent/core/session_shared.py @@ -63,9 +63,9 @@ def _make_tui_module(session, module_name): def _make_datamodel_module(session, module_name): try: from ansys.fluent.core import CODEGEN_OUTDIR - from ansys.fluent.core.codegen.datamodelgen import meshing_rule_file_names + from ansys.fluent.core.codegen.datamodelgen import datamodel_file_name_map - file_name = meshing_rule_file_names[module_name] + file_name = datamodel_file_name_map[module_name] module = pyfluent.utils.load_module( f"{module_name}_{session._version}", CODEGEN_OUTDIR / f"datamodel_{session._version}" / f"{file_name}.py", diff --git a/tests/test_codegen.py b/tests/test_codegen.py index 912f8e37bf7a..7618a9ae81fd 100644 --- a/tests/test_codegen.py +++ b/tests/test_codegen.py @@ -31,7 +31,7 @@ import ansys.fluent.core as pyfluent from ansys.fluent.core.codegen import StaticInfoType, allapigen -from ansys.fluent.core.codegen.datamodelgen import meshing_rule_file_names +from ansys.fluent.core.codegen.datamodelgen import datamodel_file_name_map from ansys.fluent.core.search import get_api_tree_file_name from ansys.fluent.core.utils.fluent_version import get_version_for_file_name @@ -388,12 +388,12 @@ def test_codegen_with_datamodel_static_info(monkeypatch, rules): datamodel_paths = list((codegen_outdir / f"datamodel_{version}").iterdir()) assert len(datamodel_paths) == 1 or 2 assert set(p.name for p in datamodel_paths) == { - f"{meshing_rule_file_names[rules]}.py" - } or {f"{meshing_rule_file_names[rules]}.pyi"} + f"{datamodel_file_name_map[rules]}.py" + } or {f"{datamodel_file_name_map[rules]}.pyi"} with open( codegen_outdir / f"datamodel_{version}" - / f"{meshing_rule_file_names[rules]}.py", + / f"{datamodel_file_name_map[rules]}.py", "r", ) as f: assert f.read().strip() == _expected_datamodel_api_output From f39d28b388588352b76db0ea81b4d1a20dac4877 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Thu, 5 Jun 2025 11:59:06 +0000 Subject: [PATCH 2/5] chore: adding changelog file 4112.miscellaneous.md [dependabot-skip] --- doc/changelog.d/4112.miscellaneous.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog.d/4112.miscellaneous.md diff --git a/doc/changelog.d/4112.miscellaneous.md b/doc/changelog.d/4112.miscellaneous.md new file mode 100644 index 000000000000..3624dfc50835 --- /dev/null +++ b/doc/changelog.d/4112.miscellaneous.md @@ -0,0 +1 @@ +Rename meshing_rule_file_names [skip tests] \ No newline at end of file From 6c42e88c90dffa4f7007fa2002fa792a09079c4c Mon Sep 17 00:00:00 2001 From: hpohekar Date: Thu, 5 Jun 2025 17:37:16 +0530 Subject: [PATCH 3/5] refactor: Rename meshing_rule_file_names to datamodel_file_name_map [skip tests] --- src/ansys/fluent/core/launcher/launcher.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ansys/fluent/core/launcher/launcher.py b/src/ansys/fluent/core/launcher/launcher.py index 1c601e16582c..fffe60cdab44 100644 --- a/src/ansys/fluent/core/launcher/launcher.py +++ b/src/ansys/fluent/core/launcher/launcher.py @@ -263,10 +263,11 @@ def launch_fluent( made by the user in the current Fluent solver session have been applied in the background Fluent solver session. This is all orchestrated by PyFluent and requires no special usage. This parameter is used only when ``case_file_name`` is provided. The default is ``False``. - mode : str, optional - Launch mode of Fluent to point to a specific session type. - The default value is ``None``. Options are ``"meshing"``, - ``"pure-meshing"`` and ``"solver"``. + mode : FluentMode or str or None, optional + Launch mode of Fluent to point to a specific session type. Can be a + ``FluentMode`` enum member or a string. The default value is ``None``. + Valid string options include ``"meshing"``, ``"pure-meshing"``, and + ``"solver"``. py : bool, optional If True, Fluent will run in Python mode. Default is None. gpu : bool or list, optional From a47cbdd3d6635813d1aecaf32da08e19cd5e8b97 Mon Sep 17 00:00:00 2001 From: hpohekar Date: Fri, 6 Jun 2025 09:04:11 +0530 Subject: [PATCH 4/5] refactor: update docker files --- docker/fluent_222/Dockerfile | 23 ++++++++++++----------- docker/fluent_231/Dockerfile | 23 ++++++++++++----------- docker/fluent_232/Dockerfile | 23 ++++++++++++----------- docker/fluent_241/Dockerfile | 23 ++++++++++++----------- docker/fluent_242/Dockerfile | 23 ++++++++++++----------- docker/fluent_251/Dockerfile | 23 ++++++++++++----------- docker/fluent_252/Dockerfile | 23 ++++++++++++----------- docker/fluent_dev/Dockerfile | 23 ++++++++++++----------- 8 files changed, 96 insertions(+), 88 deletions(-) diff --git a/docker/fluent_222/Dockerfile b/docker/fluent_222/Dockerfile index 2fa06d441e76..8244b6309bcf 100644 --- a/docker/fluent_222/Dockerfile +++ b/docker/fluent_222/Dockerfile @@ -22,19 +22,20 @@ LABEL org.opencontainers.image.documentation="https://fluent.docs.pyansys.com" # Install dependencies RUN apt-get -y update && apt-get -y install \ - csh \ - fontconfig \ - libxi-dev \ - libsm6 \ - libice-dev \ - libxrandr-dev \ - libxinerama-dev \ - libxcursor-dev \ - libglu1-mesa \ - libglvnd-dev && apt-get clean all + csh \ + fontconfig \ + libxi-dev \ + libsm6 \ + libice-dev \ + libxrandr-dev \ + libxinerama-dev \ + libxcursor-dev \ + libglu1-mesa \ + libglvnd-dev && apt-get clean all # Specify working directory -ENV WORKING_DIRECTORY=/home/$USERNAME/$WORKING_DIRECTORY +ARG WORK_DIR=fluent_work_dir +ENV WORKING_DIRECTORY=/home/$USERNAME/$WORK_DIR # Specify home directory ENV HOME=/home/$USERNAME diff --git a/docker/fluent_231/Dockerfile b/docker/fluent_231/Dockerfile index 3af72c2d974a..f9db2e594ec5 100644 --- a/docker/fluent_231/Dockerfile +++ b/docker/fluent_231/Dockerfile @@ -22,19 +22,20 @@ LABEL org.opencontainers.image.documentation="https://fluent.docs.pyansys.com" # Install dependencies RUN apt-get -y update && apt-get -y install \ - csh \ - fontconfig \ - libxi-dev \ - libsm6 \ - libice-dev \ - libxrandr-dev \ - libxinerama-dev \ - libxcursor-dev \ - libglu1-mesa \ - libglvnd-dev && apt-get clean all + csh \ + fontconfig \ + libxi-dev \ + libsm6 \ + libice-dev \ + libxrandr-dev \ + libxinerama-dev \ + libxcursor-dev \ + libglu1-mesa \ + libglvnd-dev && apt-get clean all # Specify working directory -ENV WORKING_DIRECTORY=/home/$USERNAME/$WORKING_DIRECTORY +ARG WORK_DIR=fluent_work_dir +ENV WORKING_DIRECTORY=/home/$USERNAME/$WORK_DIR # Specify home directory ENV HOME=/home/$USERNAME diff --git a/docker/fluent_232/Dockerfile b/docker/fluent_232/Dockerfile index 0f793fcc6873..086f8c01f5c4 100644 --- a/docker/fluent_232/Dockerfile +++ b/docker/fluent_232/Dockerfile @@ -22,19 +22,20 @@ LABEL org.opencontainers.image.documentation="https://fluent.docs.pyansys.com" # Install dependencies RUN apt-get -y update && apt-get -y install \ - csh \ - fontconfig \ - libxi-dev \ - libsm6 \ - libice-dev \ - libxrandr-dev \ - libxinerama-dev \ - libxcursor-dev \ - libglu1-mesa \ - libglvnd-dev && apt-get clean all + csh \ + fontconfig \ + libxi-dev \ + libsm6 \ + libice-dev \ + libxrandr-dev \ + libxinerama-dev \ + libxcursor-dev \ + libglu1-mesa \ + libglvnd-dev && apt-get clean all # Specify working directory -ENV WORKING_DIRECTORY=/home/$USERNAME/$WORKING_DIRECTORY +ARG WORK_DIR=fluent_work_dir +ENV WORKING_DIRECTORY=/home/$USERNAME/$WORK_DIR # Specify home directory ENV HOME=/home/$USERNAME diff --git a/docker/fluent_241/Dockerfile b/docker/fluent_241/Dockerfile index 84d2aeeaee31..481106984100 100644 --- a/docker/fluent_241/Dockerfile +++ b/docker/fluent_241/Dockerfile @@ -22,19 +22,20 @@ LABEL org.opencontainers.image.documentation="https://fluent.docs.pyansys.com" # Install dependencies RUN apt-get -y update && apt-get -y install \ - csh \ - fontconfig \ - libxi-dev \ - libsm6 \ - libice-dev \ - libxrandr-dev \ - libxinerama-dev \ - libxcursor-dev \ - libglu1-mesa \ - libglvnd-dev && apt-get clean all + csh \ + fontconfig \ + libxi-dev \ + libsm6 \ + libice-dev \ + libxrandr-dev \ + libxinerama-dev \ + libxcursor-dev \ + libglu1-mesa \ + libglvnd-dev && apt-get clean all # Specify working directory -ENV WORKING_DIRECTORY=/home/$USERNAME/$WORKING_DIRECTORY +ARG WORK_DIR=fluent_work_dir +ENV WORKING_DIRECTORY=/home/$USERNAME/$WORK_DIR # Specify home directory ENV HOME=/home/$USERNAME diff --git a/docker/fluent_242/Dockerfile b/docker/fluent_242/Dockerfile index f635194bb7a8..3d420d0f1ba8 100644 --- a/docker/fluent_242/Dockerfile +++ b/docker/fluent_242/Dockerfile @@ -22,19 +22,20 @@ LABEL org.opencontainers.image.documentation="https://fluent.docs.pyansys.com" # Install dependencies RUN apt-get -y update && apt-get -y install \ - csh \ - fontconfig \ - libxi-dev \ - libsm6 \ - libice-dev \ - libxrandr-dev \ - libxinerama-dev \ - libxcursor-dev \ - libglu1-mesa \ - libglvnd-dev && apt-get clean all + csh \ + fontconfig \ + libxi-dev \ + libsm6 \ + libice-dev \ + libxrandr-dev \ + libxinerama-dev \ + libxcursor-dev \ + libglu1-mesa \ + libglvnd-dev && apt-get clean all # Specify working directory -ENV WORKING_DIRECTORY=/home/$USERNAME/$WORKING_DIRECTORY +ARG WORK_DIR=fluent_work_dir +ENV WORKING_DIRECTORY=/home/$USERNAME/$WORK_DIR # Specify home directory ENV HOME=/home/$USERNAME diff --git a/docker/fluent_251/Dockerfile b/docker/fluent_251/Dockerfile index d6b3151327cd..d19ca11a9511 100644 --- a/docker/fluent_251/Dockerfile +++ b/docker/fluent_251/Dockerfile @@ -22,19 +22,20 @@ LABEL org.opencontainers.image.documentation="https://fluent.docs.pyansys.com" # Install dependencies RUN apt-get -y update && apt-get -y install \ - csh \ - fontconfig \ - libxi-dev \ - libsm6 \ - libice-dev \ - libxrandr-dev \ - libxinerama-dev \ - libxcursor-dev \ - libglu1-mesa \ - libglvnd-dev && apt-get clean all + csh \ + fontconfig \ + libxi-dev \ + libsm6 \ + libice-dev \ + libxrandr-dev \ + libxinerama-dev \ + libxcursor-dev \ + libglu1-mesa \ + libglvnd-dev && apt-get clean all # Specify working directory -ENV WORKING_DIRECTORY=/home/$USERNAME/$WORKING_DIRECTORY +ARG WORK_DIR=fluent_work_dir +ENV WORKING_DIRECTORY=/home/$USERNAME/$WORK_DIR # Specify home directory ENV HOME=/home/$USERNAME diff --git a/docker/fluent_252/Dockerfile b/docker/fluent_252/Dockerfile index 58e391bf01f3..00b7414affe8 100644 --- a/docker/fluent_252/Dockerfile +++ b/docker/fluent_252/Dockerfile @@ -22,19 +22,20 @@ LABEL org.opencontainers.image.documentation="https://fluent.docs.pyansys.com" # Install dependencies RUN apt-get -y update && apt-get -y install \ - csh \ - fontconfig \ - libxi-dev \ - libsm6 \ - libice-dev \ - libxrandr-dev \ - libxinerama-dev \ - libxcursor-dev \ - libglu1-mesa \ - libglvnd-dev && apt-get clean all + csh \ + fontconfig \ + libxi-dev \ + libsm6 \ + libice-dev \ + libxrandr-dev \ + libxinerama-dev \ + libxcursor-dev \ + libglu1-mesa \ + libglvnd-dev && apt-get clean all # Specify working directory -ENV WORKING_DIRECTORY=/home/$USERNAME/$WORKING_DIRECTORY +ARG WORK_DIR=fluent_work_dir +ENV WORKING_DIRECTORY=/home/$USERNAME/$WORK_DIR # Specify home directory ENV HOME=/home/$USERNAME diff --git a/docker/fluent_dev/Dockerfile b/docker/fluent_dev/Dockerfile index 5fc0f7072768..d83750449103 100644 --- a/docker/fluent_dev/Dockerfile +++ b/docker/fluent_dev/Dockerfile @@ -22,19 +22,20 @@ LABEL org.opencontainers.image.documentation="https://fluent.docs.pyansys.com" # Install dependencies RUN apt-get -y update && apt-get -y install \ - csh \ - fontconfig \ - libxi-dev \ - libsm6 \ - libice-dev \ - libxrandr-dev \ - libxinerama-dev \ - libxcursor-dev \ - libglu1-mesa \ - libglvnd-dev && apt-get clean all + csh \ + fontconfig \ + libxi-dev \ + libsm6 \ + libice-dev \ + libxrandr-dev \ + libxinerama-dev \ + libxcursor-dev \ + libglu1-mesa \ + libglvnd-dev && apt-get clean all # Specify working directory -ENV WORKING_DIRECTORY=/home/$USERNAME/$WORKING_DIRECTORY +ARG WORK_DIR=fluent_work_dir +ENV WORKING_DIRECTORY=/home/$USERNAME/$WORK_DIR # Specify home directory ENV HOME=/home/$USERNAME From 360f7ddb356003203477202bf6d216d797100686 Mon Sep 17 00:00:00 2001 From: hpohekar Date: Fri, 6 Jun 2025 09:12:54 +0530 Subject: [PATCH 5/5] refactor: update docker files docs --- doc/source/user_guide/make_container_image.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/user_guide/make_container_image.rst b/doc/source/user_guide/make_container_image.rst index 3640d715cc20..17ce4aecdca5 100644 --- a/doc/source/user_guide/make_container_image.rst +++ b/doc/source/user_guide/make_container_image.rst @@ -39,8 +39,8 @@ command line arguments and run this script to copy needed files from the Ansys i * These files indicate the files that are excluded during the copying: - * `excludeCEIList.txt `_ - * `excludeFluentList.txt `_ + * `excludeCEIList.txt `_ + * `excludeFluentList.txt `_ 1. Above excluded files are not needed to run typical Fluent workflows.