Skip to content

Commit

Permalink
refactor: gRPC FTS refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
hpohekar committed Apr 29, 2024
1 parent 1e1416a commit 266a2b7
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 14 deletions.
8 changes: 5 additions & 3 deletions src/ansys/fluent/core/launcher/container_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ class DockerLauncher:

def __init__(
self,
mode: FluentMode,
ui_mode: UIMode,
graphics_driver: Union[FluentWindowsGraphicsDriver, FluentLinuxGraphicsDriver],
mode: Optional[Union[FluentMode, str, None]] = None,
ui_mode: Union[UIMode, str, None] = None,
graphics_driver: Union[
FluentWindowsGraphicsDriver, FluentLinuxGraphicsDriver, str, None
] = None,
product_version: Optional[FluentVersion] = None,
version: Optional[str] = None,
precision: Optional[str] = None,
Expand Down
13 changes: 8 additions & 5 deletions src/ansys/fluent/core/launcher/fluent_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
import tempfile
from typing import List, Optional, Union

import ansys.fluent.core as pyfluent
from ansys.fluent.core._version import fluent_release_version
from ansys.fluent.core.session import _parse_server_info_file
from ansys.fluent.core.utils.execution import timeout_loop
Expand Down Expand Up @@ -179,9 +178,7 @@ def configure_container_dict(
else:
logger.debug(f"container_dict before processing: {container_dict}")

if not host_mount_path:
host_mount_path = pyfluent.EXAMPLES_PATH
elif "volumes" in container_dict:
if "volumes" in container_dict:
logger.warning(
"'volumes' keyword specified in 'container_dict', but "
"it is going to be overwritten by specified 'host_mount_path'."
Expand All @@ -203,7 +200,13 @@ def configure_container_dict(
container_dict.pop("volumes")

if "volumes" not in container_dict:
container_dict.update(volumes=[f"{host_mount_path}:{container_mount_path}"])
container_dict.update(
volumes=(
[f"{host_mount_path}:{container_mount_path}"]
if host_mount_path
else [f"pyfluent_data:{container_mount_path}"]
)
)
else:
logger.debug(f"container_dict['volumes']: {container_dict['volumes']}")
if len(container_dict["volumes"]) != 1:
Expand Down
8 changes: 5 additions & 3 deletions src/ansys/fluent/core/launcher/pim_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ class PIMLauncher:

def __init__(
self,
mode: FluentMode,
ui_mode: UIMode,
graphics_driver: Union[FluentWindowsGraphicsDriver, FluentLinuxGraphicsDriver],
mode: Optional[Union[FluentMode, str, None]] = None,
ui_mode: Union[UIMode, str, None] = None,
graphics_driver: Union[
FluentWindowsGraphicsDriver, FluentLinuxGraphicsDriver, str, None
] = None,
product_version: Optional[FluentVersion] = None,
version: Optional[str] = None,
precision: Optional[str] = None,
Expand Down
8 changes: 5 additions & 3 deletions src/ansys/fluent/core/launcher/standalone_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@ class StandaloneLauncher:

def __init__(
self,
mode: FluentMode,
ui_mode: UIMode,
graphics_driver: Union[FluentWindowsGraphicsDriver, FluentLinuxGraphicsDriver],
mode: Optional[Union[FluentMode, str, None]] = None,
ui_mode: Union[UIMode, str, None] = None,
graphics_driver: Union[
FluentWindowsGraphicsDriver, FluentLinuxGraphicsDriver, str, None
] = None,
product_version: Optional[FluentVersion] = None,
version: Optional[str] = None,
precision: Optional[str] = None,
Expand Down

0 comments on commit 266a2b7

Please sign in to comment.