diff --git a/src/ansys/fluent/core/systemcoupling.py b/src/ansys/fluent/core/systemcoupling.py index e8117f92b6d..a5c9b80bde9 100644 --- a/src/ansys/fluent/core/systemcoupling.py +++ b/src/ansys/fluent/core/systemcoupling.py @@ -5,7 +5,6 @@ from typing import List import xml.etree.ElementTree as XmlET -import ansys.fluent.core as pyfluent from ansys.fluent.core.utils.fluent_version import FluentVersion @@ -97,9 +96,9 @@ def get_scp_string() -> str: elif self._solver.connection_properties.inside_container: # Right now, the way that PyFluent containers and tests are set up, # the local Fluent container working directory will correspond to - # pyfluent.EXAMPLES_PATH in the host, so that is where the SCP file + # os.getcwd() in the host, so that is where the SCP file # will be written. - examples_path_scp = os.path.join(pyfluent.EXAMPLES_PATH, scp_file_name) + examples_path_scp = os.path.join(os.getcwd(), scp_file_name) if os.path.exists(examples_path_scp): scp_file_name = examples_path_scp diff --git a/src/ansys/fluent/core/utils/data_transfer.py b/src/ansys/fluent/core/utils/data_transfer.py index e490ee0b5f9..e5fde5ecab1 100644 --- a/src/ansys/fluent/core/utils/data_transfer.py +++ b/src/ansys/fluent/core/utils/data_transfer.py @@ -6,7 +6,6 @@ from pathlib import Path, PurePosixPath from typing import Optional -import ansys.fluent.core as pyfluent from ansys.fluent.core.launcher.fluent_container import DEFAULT_CONTAINER_MOUNT_PATH from ansys.fluent.core.utils.execution import asynchronous @@ -93,7 +92,7 @@ def transfer_case( """ inside_container = source_instance.connection_properties.inside_container if not workdir: - workdir = Path(pyfluent.EXAMPLES_PATH) + workdir = Path(os.getcwd()) else: workdir = Path(workdir) if inside_container: diff --git a/tests/parametric/test_parametric_workflow.py b/tests/parametric/test_parametric_workflow.py index bc33c99c30a..cb711e49f50 100644 --- a/tests/parametric/test_parametric_workflow.py +++ b/tests/parametric/test_parametric_workflow.py @@ -20,8 +20,8 @@ def pytest_approx(expected): @pytest.mark.fluent_version("latest") def test_parametric_workflow(): # parent path needs to exist for mkdtemp - Path(pyfluent.EXAMPLES_PATH).mkdir(parents=True, exist_ok=True) - tmp_save_path = tempfile.mkdtemp(dir=pyfluent.EXAMPLES_PATH) + Path(os.getcwd()).mkdir(parents=True, exist_ok=True) + tmp_save_path = tempfile.mkdtemp(dir=os.getcwd()) if pyfluent.USE_FILE_TRANSFER_SERVICE: file_transfer_service = RemoteFileTransferStrategy( host_mount_path=tmp_save_path diff --git a/tests/test_session.py b/tests/test_session.py index 5c2f16ff18e..955a4998176 100644 --- a/tests/test_session.py +++ b/tests/test_session.py @@ -292,7 +292,7 @@ def test_journal_creation(file_format, new_mesh_session): fd, file_name = tempfile.mkstemp( suffix=f"-{os.getpid()}.{file_format}", prefix="pyfluent-", - dir=str(pyfluent.EXAMPLES_PATH), + dir=str(os.getcwd()), ) os.close(fd) @@ -321,7 +321,7 @@ def test_start_transcript_file_write(new_mesh_session): fd, file_name = tempfile.mkstemp( suffix=f"-{os.getpid()}.trn", prefix="pyfluent-", - dir=str(pyfluent.EXAMPLES_PATH), + dir=str(os.getcwd()), ) os.close(fd) diff --git a/tests/test_solvermode/test_general.py b/tests/test_solvermode/test_general.py index 6f9caae7dcb..803320a46fa 100644 --- a/tests/test_solvermode/test_general.py +++ b/tests/test_solvermode/test_general.py @@ -3,8 +3,6 @@ import pytest -import ansys.fluent.core as pyfluent - @pytest.mark.settings_only @pytest.mark.fluent_version("latest") @@ -12,7 +10,7 @@ def test_solver_import_mixingelbow(load_mixing_elbow_settings_only): solver_session = load_mixing_elbow_settings_only assert solver_session.settings.is_active() assert solver_session.health_check.is_serving - file_name = Path(pyfluent.EXAMPLES_PATH) / "jou_test_general.py" + file_name = Path(os.getcwd()) / "jou_test_general.py" solver_session.journal.start(file_name.as_posix()) ### assert solver_session.setup.models.energy.enabled() diff --git a/tests/test_topy.py b/tests/test_topy.py index 505d86a0c45..53b97d7dea2 100644 --- a/tests/test_topy.py +++ b/tests/test_topy.py @@ -9,7 +9,7 @@ @pytest.mark.skip(reason="Unable to read generated python journal from fluent.") def test_single_jou(): - file_name = os.path.join(pyfluent.EXAMPLES_PATH, "jou1.jou") + file_name = os.path.join(os.getcwd(), "jou1.jou") with open(file_name, "w") as journal: journal.write('(display "from jou1.jou")') @@ -43,7 +43,7 @@ def test_single_jou(): @pytest.mark.skip(reason="Unable to read generated python journal from fluent.") def test_single_scm(): - file_name = os.path.join(pyfluent.EXAMPLES_PATH, "jou1.scm") + file_name = os.path.join(os.getcwd(), "jou1.scm") with open(file_name, "w") as journal: journal.write('(display "from jou1.scm")') @@ -77,8 +77,8 @@ def test_single_scm(): @pytest.mark.skip(reason="Unable to read generated python journal from fluent.") def test_2_jou(): - file_name_1 = os.path.join(pyfluent.EXAMPLES_PATH, "jou1.jou") - file_name_2 = os.path.join(pyfluent.EXAMPLES_PATH, "jou2.jou") + file_name_1 = os.path.join(os.getcwd(), "jou1.jou") + file_name_2 = os.path.join(os.getcwd(), "jou2.jou") with open(file_name_1, "w") as journal: journal.write('(display "from jou1.jou")') @@ -129,8 +129,8 @@ def test_2_jou(): @pytest.mark.skip(reason="Unable to read generated python journal from fluent.") def test_2_scm(): - file_name_1 = os.path.join(pyfluent.EXAMPLES_PATH, "jou1.scm") - file_name_2 = os.path.join(pyfluent.EXAMPLES_PATH, "jou2.scm") + file_name_1 = os.path.join(os.getcwd(), "jou1.scm") + file_name_2 = os.path.join(os.getcwd(), "jou2.scm") with open(file_name_1, "w") as journal: journal.write('(display "from jou1.scm")')