Skip to content

Commit

Permalink
refactor: Remove _MODE. (#2892)
Browse files Browse the repository at this point in the history
  • Loading branch information
prmukherj authored Jun 6, 2024
1 parent 19a42b8 commit 79947a6
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion codegen/allapigen.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/fluent/core/codegen/datamodelgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/fluent/core/codegen/tuigen.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/fluent/core/launcher/container_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/fluent/core/launcher/pim_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions src/ansys/fluent/core/launcher/pyfluent_enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/fluent/core/launcher/slurm_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/fluent/core/launcher/standalone_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions tests/test_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand All @@ -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
Expand Down

0 comments on commit 79947a6

Please sign in to comment.