Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Remove _MODE. #2892

Merged
merged 3 commits into from
Jun 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion codegen/allapigen.py
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion src/ansys/fluent/core/codegen/datamodelgen.py
Original file line number Diff line number Diff line change
@@ -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(
2 changes: 1 addition & 1 deletion src/ansys/fluent/core/codegen/tuigen.py
Original file line number Diff line number Diff line change
@@ -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:
2 changes: 1 addition & 1 deletion src/ansys/fluent/core/launcher/container_launcher.py
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion src/ansys/fluent/core/launcher/pim_launcher.py
Original file line number Diff line number Diff line change
@@ -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)
8 changes: 4 additions & 4 deletions src/ansys/fluent/core/launcher/pyfluent_enums.py
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion src/ansys/fluent/core/launcher/slurm_launcher.py
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion src/ansys/fluent/core/launcher/standalone_launcher.py
Original file line number Diff line number Diff line change
@@ -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)
6 changes: 3 additions & 3 deletions tests/test_launcher.py
Original file line number Diff line number Diff line change
@@ -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