From 79947a67474887bd6e34092878db953ef91f00a0 Mon Sep 17 00:00:00 2001 From: Prithwish Mukherjee <109645853+prmukherj@users.noreply.github.com> Date: Thu, 6 Jun 2024 22:46:29 +0530 Subject: [PATCH] refactor: Remove _MODE. (#2892) --- codegen/allapigen.py | 2 +- src/ansys/fluent/core/codegen/datamodelgen.py | 2 +- src/ansys/fluent/core/codegen/tuigen.py | 2 +- src/ansys/fluent/core/launcher/container_launcher.py | 2 +- src/ansys/fluent/core/launcher/pim_launcher.py | 2 +- src/ansys/fluent/core/launcher/pyfluent_enums.py | 8 ++++---- src/ansys/fluent/core/launcher/slurm_launcher.py | 2 +- src/ansys/fluent/core/launcher/standalone_launcher.py | 2 +- tests/test_launcher.py | 6 +++--- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/codegen/allapigen.py b/codegen/allapigen.py index 6a2e0dd4a7e..fef86032873 100644 --- a/codegen/allapigen.py +++ b/codegen/allapigen.py @@ -9,7 +9,7 @@ if __name__ == "__main__": t0 = time() - meshing = launch_fluent(mode=FluentMode.MESHING_MODE) + meshing = launch_fluent(mode=FluentMode.MESHING) version = get_version_for_file_name(session=meshing) gt_222 = FluentVersion(version) > FluentVersion.v222 ge_231 = FluentVersion(version) >= FluentVersion.v231 diff --git a/src/ansys/fluent/core/codegen/datamodelgen.py b/src/ansys/fluent/core/codegen/datamodelgen.py index ca7b9bc7737..6ac58527c34 100644 --- a/src/ansys/fluent/core/codegen/datamodelgen.py +++ b/src/ansys/fluent/core/codegen/datamodelgen.py @@ -380,7 +380,7 @@ def generate(version, static_infos: dict): if __name__ == "__main__": solver = launch_fluent() - meshing = launch_fluent(mode=FluentMode.MESHING_MODE) + meshing = launch_fluent(mode=FluentMode.MESHING) version = get_version_for_file_name(session=solver) static_infos = { StaticInfoType.DATAMODEL_WORKFLOW: meshing._datamodel_service_se.get_static_info( diff --git a/src/ansys/fluent/core/codegen/tuigen.py b/src/ansys/fluent/core/codegen/tuigen.py index 87c6737d191..fb0fd489ac3 100644 --- a/src/ansys/fluent/core/codegen/tuigen.py +++ b/src/ansys/fluent/core/codegen/tuigen.py @@ -324,7 +324,7 @@ def generate(version, static_infos: dict): if __name__ == "__main__": solver = launch_fluent() - meshing = launch_fluent(mode=FluentMode.MESHING_MODE) + meshing = launch_fluent(mode=FluentMode.MESHING) version = get_version_for_file_name(session=solver) static_infos = {} if FluentVersion(version) > FluentVersion.v222: diff --git a/src/ansys/fluent/core/launcher/container_launcher.py b/src/ansys/fluent/core/launcher/container_launcher.py index 74278c32ea8..80db74a22f3 100644 --- a/src/ansys/fluent/core/launcher/container_launcher.py +++ b/src/ansys/fluent/core/launcher/container_launcher.py @@ -6,7 +6,7 @@ >>> from ansys.fluent.core.launcher.launcher import create_launcher >>> from ansys.fluent.core.launcher.pyfluent_enums import LaunchMode, FluentMode ->>> container_meshing_launcher = create_launcher(LaunchMode.CONTAINER, mode=FluentMode.MESHING_MODE) +>>> container_meshing_launcher = create_launcher(LaunchMode.CONTAINER, mode=FluentMode.MESHING) >>> container_meshing_session = container_meshing_launcher() >>> container_solver_launcher = create_launcher(LaunchMode.CONTAINER) diff --git a/src/ansys/fluent/core/launcher/pim_launcher.py b/src/ansys/fluent/core/launcher/pim_launcher.py index 42171fc0f5b..5f2c5394e71 100644 --- a/src/ansys/fluent/core/launcher/pim_launcher.py +++ b/src/ansys/fluent/core/launcher/pim_launcher.py @@ -6,7 +6,7 @@ >>> from ansys.fluent.core.launcher.launcher import create_launcher >>> from ansys.fluent.core.launcher.pyfluent_enums import LaunchMode, FluentMode ->>> pim_meshing_launcher = create_launcher(LaunchMode.PIM, mode=FluentMode.MESHING_MODE) +>>> pim_meshing_launcher = create_launcher(LaunchMode.PIM, mode=FluentMode.MESHING) >>> pim_meshing_session = pim_meshing_launcher() >>> pim_solver_launcher = create_launcher(LaunchMode.PIM) diff --git a/src/ansys/fluent/core/launcher/pyfluent_enums.py b/src/ansys/fluent/core/launcher/pyfluent_enums.py index eb481db8e91..5eedc4bee76 100644 --- a/src/ansys/fluent/core/launcher/pyfluent_enums.py +++ b/src/ansys/fluent/core/launcher/pyfluent_enums.py @@ -29,8 +29,8 @@ class LaunchMode(Enum): class FluentMode(Enum): """Enumerates over supported Fluent modes.""" - MESHING_MODE = (Meshing, "meshing") - PURE_MESHING_MODE = (PureMeshing, "pure-meshing") + MESHING = (Meshing, "meshing") + PURE_MESHING = (PureMeshing, "pure-meshing") SOLVER = (Solver, "solver") SOLVER_ICING = (SolverIcing, "solver-icing") @@ -72,10 +72,10 @@ def is_meshing(mode: "FluentMode") -> bool: Returns ------- bool - ``True`` if the mode is ``FluentMode.MESHING_MODE`` or ``FluentMode.PURE_MESHING_MODE``, + ``True`` if the mode is ``FluentMode.MESHING`` or ``FluentMode.PURE_MESHING``, ``False`` otherwise. """ - return mode in [FluentMode.MESHING_MODE, FluentMode.PURE_MESHING_MODE] + return mode in [FluentMode.MESHING, FluentMode.PURE_MESHING] @total_ordering diff --git a/src/ansys/fluent/core/launcher/slurm_launcher.py b/src/ansys/fluent/core/launcher/slurm_launcher.py index 64ac67adab8..2fa8b49a9a7 100644 --- a/src/ansys/fluent/core/launcher/slurm_launcher.py +++ b/src/ansys/fluent/core/launcher/slurm_launcher.py @@ -32,7 +32,7 @@ >>> from ansys.fluent.core.launcher.launcher import create_launcher >>> from ansys.fluent.core.launcher.pyfluent_enums import LaunchMode, FluentMode ->>> slurm_meshing_launcher = create_launcher(LaunchMode.SLURM, mode=FluentMode.MESHING_MODE) +>>> slurm_meshing_launcher = create_launcher(LaunchMode.SLURM, mode=FluentMode.MESHING) >>> slurm_meshing_session = slurm_meshing_launcher() >>> slurm_solver_launcher = create_launcher(LaunchMode.SLURM) diff --git a/src/ansys/fluent/core/launcher/standalone_launcher.py b/src/ansys/fluent/core/launcher/standalone_launcher.py index ac124620122..6112c48f6f4 100644 --- a/src/ansys/fluent/core/launcher/standalone_launcher.py +++ b/src/ansys/fluent/core/launcher/standalone_launcher.py @@ -6,7 +6,7 @@ >>> from ansys.fluent.core.launcher.launcher import create_launcher >>> from ansys.fluent.core.launcher.pyfluent_enums import LaunchMode, FluentMode ->>> standalone_meshing_launcher = create_launcher(LaunchMode.STANDALONE, mode=FluentMode.MESHING_MODE) +>>> standalone_meshing_launcher = create_launcher(LaunchMode.STANDALONE, mode=FluentMode.MESHING) >>> standalone_meshing_session = standalone_meshing_launcher() >>> standalone_solver_launcher = create_launcher(LaunchMode.STANDALONE) diff --git a/tests/test_launcher.py b/tests/test_launcher.py index 53315e3d2cc..146c12da1ac 100644 --- a/tests/test_launcher.py +++ b/tests/test_launcher.py @@ -308,7 +308,7 @@ def test_fluent_launchers(): ) if not check_docker_support() and not pypim.is_configured(): standalone_meshing_launcher = create_launcher( - LaunchMode.STANDALONE, mode=FluentMode.MESHING_MODE, **kwargs + LaunchMode.STANDALONE, mode=FluentMode.MESHING, **kwargs ) standalone_meshing_session = standalone_meshing_launcher() assert standalone_meshing_session @@ -340,7 +340,7 @@ def test_fluent_launchers(): ) container_meshing_launcher = create_launcher( LaunchMode.CONTAINER, - mode=FluentMode.MESHING_MODE, + mode=FluentMode.MESHING, **kargs, ) container_meshing_session = container_meshing_launcher() @@ -356,7 +356,7 @@ def test_fluent_launchers(): if pypim.is_configured(): pim_meshing_launcher = create_launcher( - LaunchMode.PIM, mode=FluentMode.MESHING_MODE, **kwargs + LaunchMode.PIM, mode=FluentMode.MESHING, **kwargs ) pim_meshing_session = pim_meshing_launcher() assert pim_meshing_session