Skip to content

Commit

Permalink
restructuring
Browse files Browse the repository at this point in the history
  • Loading branch information
hpohekar committed Oct 21, 2024
1 parent 6d9a491 commit 01201b1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
3 changes: 0 additions & 3 deletions src/ansys/fluent/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,6 @@ def version_info() -> str:
platformdirs.user_documents_dir(), "ansys_fluent_core_examples"
)

# Working directory for the Fluent client
CWD = None

# Host path which is mounted to the container
CONTAINER_MOUNT_SOURCE = None

Expand Down
6 changes: 5 additions & 1 deletion src/ansys/fluent/core/fluent_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import psutil

import ansys.fluent.core as pyfluent
from ansys.fluent.core.launcher.error_handler import _check_license
from ansys.fluent.core.services import service_creator
from ansys.fluent.core.services.scheme_eval import SchemeEvalService
from ansys.fluent.core.utils.execution import timeout_exec, timeout_loop
Expand Down Expand Up @@ -382,7 +383,10 @@ def __init__(
# throws, we should not proceed.
# TODO: Show user-friendly error message.
if pyfluent.CHECK_HEALTH:
self.health_check.check_health()
try:
self.health_check.check_health()
except RuntimeError:
_check_license()

self._slurm_job_id = slurm_job_id

Expand Down
3 changes: 0 additions & 3 deletions src/ansys/fluent/core/launcher/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,6 @@ def launch_fluent(
if env is None:
env = {}

if cwd:
pyfluent.CWD = cwd

def _mode_to_launcher_type(fluent_launch_mode: LaunchMode):
launcher_mode_type = {
LaunchMode.CONTAINER: DockerLauncher,
Expand Down
4 changes: 1 addition & 3 deletions src/ansys/fluent/core/services/interceptors.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from google.protobuf.message import Message
import grpc

from ansys.fluent.core.launcher.error_handler import _check_license
from ansys.fluent.core.services.batch_ops import BatchOps

network_logger: logging.Logger = logging.getLogger("pyfluent.networking")
Expand Down Expand Up @@ -110,8 +109,7 @@ def _intercept_call(
grpc_ex = response.exception()
ex = RuntimeError(grpc_ex.details())
ex.__context__ = grpc_ex
if not _check_license():
raise ex from None
raise ex from None
return response

def intercept_unary_unary(
Expand Down

0 comments on commit 01201b1

Please sign in to comment.