diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 8a99fc9f..420fe112 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -50,7 +50,7 @@ jobs: strategy: fail-fast: false matrix: - image-tag: [v22.2.0, v23.1.0, v23.2.0] + image-tag: [v22.2.0, v23.1.0, v23.2.0, v24.1.0] steps: - uses: actions/checkout@v3 @@ -86,20 +86,11 @@ jobs: needs: [docs-style] runs-on: [self-hosted, pyfluent] env: - DOC_DEPLOYMENT_IMAGE_TAG: v23.1.0 + DOC_DEPLOYMENT_IMAGE_TAG: v23.2.0 DOCUMENTATION_CNAME: 'parametric.fluent.docs.pyansys.com' steps: - uses: actions/checkout@v3 - # used for documentation deployment - - name: Get Bot Application Token - if: github.event_name == 'push' && contains(github.ref, 'refs/tags') - id: get_workflow_token - uses: peter-murray/workflow-application-token-action@v2 - with: - application_id: ${{ secrets.BOT_APPLICATION_ID }} - application_private_key: ${{ secrets.BOT_APPLICATION_PRIVATE_KEY }} - - name: Set up Python uses: actions/setup-python@v4 with: diff --git a/.github/workflows/nightly-doc-build.yml b/.github/workflows/nightly-doc-build.yml index 38c29cf7..5d10af3a 100644 --- a/.github/workflows/nightly-doc-build.yml +++ b/.github/workflows/nightly-doc-build.yml @@ -7,7 +7,7 @@ on: env: DOCUMENTATION_CNAME: 'parametric.fluent.docs.pyansys.com' - DOC_DEPLOYMENT_IMAGE_TAG: v23.1.0 + DOC_DEPLOYMENT_IMAGE_TAG: v23.2.0 ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} PYFLUENT_TIMEOUT_FORCE_EXIT: 5 PYFLUENT_LAUNCH_CONTAINER: 1 @@ -23,14 +23,6 @@ jobs: steps: - uses: actions/checkout@v3 - # used for documentation deployment - - name: Get Bot Application Token - id: get_workflow_token - uses: peter-murray/workflow-application-token-action@v2 - with: - application_id: ${{ secrets.BOT_APPLICATION_ID }} - application_private_key: ${{ secrets.BOT_APPLICATION_PRIVATE_KEY }} - - name: Set up Python uses: actions/setup-python@v4 with: @@ -65,7 +57,7 @@ jobs: retention-days: 7 - name: Deploy - if: matrix.image-tag == 'v23.1.0' + if: matrix.image-tag == ${{ env.DOC_DEPLOYMENT_IMAGE_TAG }} uses: ansys/actions/doc-deploy-dev@v4 with: doc-artifact-name: HTML-Documentation-tag-${{ env.DOC_DEPLOYMENT_IMAGE_TAG }} diff --git a/.github/workflows/nightly-test-run.yml b/.github/workflows/nightly-test-run.yml index b1a07e11..fc13998a 100644 --- a/.github/workflows/nightly-test-run.yml +++ b/.github/workflows/nightly-test-run.yml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - image-tag: [v22.2.0, v23.1.0, v23.2.0] + image-tag: [v22.2.0, v23.1.0, v23.2.0, v24.1.0] steps: - uses: actions/checkout@v3 diff --git a/doc/source/conf.py b/doc/source/conf.py index 91f0d657..366c0b60 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -28,7 +28,7 @@ # necessary when building the sphinx gallery pyvista.BUILDING_GALLERY = True -pyfluent.BUILDING_GALLERY = True +pyfluent.launcher.fluent_container.DEFAULT_CONTAINER_MOUNT_PATH = pyfluent.EXAMPLES_PATH # -- Project information ----------------------------------------------------- diff --git a/examples/00-parametric/parametric_static_mixer_1.py b/examples/00-parametric/parametric_static_mixer_1.py index 6d400576..f2d453c7 100644 --- a/examples/00-parametric/parametric_static_mixer_1.py +++ b/examples/00-parametric/parametric_static_mixer_1.py @@ -35,7 +35,7 @@ # Download the files for this example and read the case for the static mixer. import_filename = examples.download_file( - "Static_Mixer_main.cas.h5", "pyfluent/static_mixer" + "Static_Mixer_main.cas.h5", "pyfluent/static_mixer", return_only_filename=False ) solver_session.tui.file.read_case(import_filename) diff --git a/pyproject.toml b/pyproject.toml index 4134858a..e05299bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ packages = [ [tool.poetry.dependencies] python = ">=3.8,<4.0" importlib-metadata = {version = "^4.0", python = "<3.8"} -ansys-fluent-core = "~=0.14.dev0" +ansys-fluent-core = "~=0.17.dev0" h5py = ">=3.7.0" [tool.black] diff --git a/src/ansys/fluent/parametric/__init__.py b/src/ansys/fluent/parametric/__init__.py index 3905deef..cc909c3a 100644 --- a/src/ansys/fluent/parametric/__init__.py +++ b/src/ansys/fluent/parametric/__init__.py @@ -53,7 +53,7 @@ >>> session2 = ParametricSession(project_filepath="nozzle_para_named.flprj") """ import logging -from pathlib import Path +from pathlib import Path, PurePosixPath, PureWindowsPath import tempfile from typing import Any, Dict, List, Optional @@ -507,8 +507,13 @@ def open( load_case : bool, optional Whether to load the current case. The default ``True``. """ + if ( + not PureWindowsPath(project_filepath).is_absolute() + or not PurePosixPath(project_filepath).is_absolute() + ): + project_filepath = str(Path(project_filepath).resolve()) self._parametric_project.open( - project_filename=str(Path(project_filepath).resolve()), + project_filename=project_filepath, load_case=load_case, ) self.project_filepath = project_filepath diff --git a/src/ansys/fluent/parametric/local/__init__.py b/src/ansys/fluent/parametric/local/__init__.py index 01fe0e80..0d86178e 100644 --- a/src/ansys/fluent/parametric/local/__init__.py +++ b/src/ansys/fluent/parametric/local/__init__.py @@ -35,7 +35,7 @@ from typing import Any, Dict, Union from ansys.fluent.core.filereader.casereader import CaseReader -from ansys.fluent.core.utils.async_execution import asynchronous +from ansys.fluent.core.utils.execution import asynchronous from ansys.fluent.parametric import ( BASE_DP_NAME, diff --git a/tests/test_local_parametric_run.py b/tests/test_local_parametric_run.py index 25d25699..75ccb424 100644 --- a/tests/test_local_parametric_run.py +++ b/tests/test_local_parametric_run.py @@ -8,7 +8,9 @@ from math import inf +import ansys.fluent.core as pyfluent from ansys.fluent.core import examples +import pytest from ansys.fluent.parametric.local import ( LocalParametricStudy, @@ -16,15 +18,18 @@ ) -def test_local_parametric_setup(): +def test_local_parametric_setup(monkeypatch: pytest.MonkeyPatch): + monkeypatch.setenv("PYFLUENT_CONTAINER_MOUNT_PATH", pyfluent.EXAMPLES_PATH) ############################################################################ # Read the hopper/mixer case - case_filename = examples.download_file( - "Static_Mixer_Parameters.cas.h5", "pyfluent/static_mixer" + case_filepath = examples.download_file( + "Static_Mixer_Parameters.cas.h5", + "pyfluent/static_mixer", + return_only_filename=False, ) - local_study = LocalParametricStudy(case_filepath=case_filename) + local_study = LocalParametricStudy(case_filepath=case_filepath) for idx in range(20): design_point = local_study.add_design_point("dp_" + str(idx)) diff --git a/tests/test_local_parametric_setup.py b/tests/test_local_parametric_setup.py index f25b42d4..2cccf6ec 100644 --- a/tests/test_local_parametric_setup.py +++ b/tests/test_local_parametric_setup.py @@ -3,22 +3,27 @@ TODO """ +import ansys.fluent.core as pyfluent from ansys.fluent.core import examples +import pytest from ansys.fluent.parametric.local import LocalParametricStudy ############################################################################ -def test_local_parametric_setup(): +def test_local_parametric_setup(monkeypatch: pytest.MonkeyPatch): + monkeypatch.setenv("PYFLUENT_CONTAINER_MOUNT_PATH", pyfluent.EXAMPLES_PATH) ############################################################################ # Read the hopper/mixer case - case_filename = examples.download_file( - "Static_Mixer_Parameters.cas.h5", "pyfluent/static_mixer" + case_filepath = examples.download_file( + "Static_Mixer_Parameters.cas.h5", + "pyfluent/static_mixer", + return_only_filename=False, ) - local_study = LocalParametricStudy(case_filepath=case_filename) + local_study = LocalParametricStudy(case_filepath=case_filepath) base_design_point = local_study.design_point("Base DP") diff --git a/tests/test_parametric_session.py b/tests/test_parametric_session.py index 2ca1fb5d..f6cce065 100644 --- a/tests/test_parametric_session.py +++ b/tests/test_parametric_session.py @@ -1,11 +1,16 @@ +import ansys.fluent.core as pyfluent from ansys.fluent.core import examples +import pytest from ansys.fluent.parametric import ParametricSession -def test_parametric_session(): +def test_parametric_session(monkeypatch: pytest.MonkeyPatch): + monkeypatch.setenv("PYFLUENT_CONTAINER_MOUNT_PATH", pyfluent.EXAMPLES_PATH) project_filepath = examples.download_file( - "project-elbow-param.flprz", "pyfluent/mixing_elbow" + "project-elbow-param.flprz", + "pyfluent/mixing_elbow", + return_only_filename=False, ) session = ParametricSession(project_filepath=project_filepath) assert "Static_Mixer_main-Solve" in session.studies diff --git a/tests/test_parametric_workflow.py b/tests/test_parametric_workflow.py index 44a39f82..5cb00b9a 100644 --- a/tests/test_parametric_workflow.py +++ b/tests/test_parametric_workflow.py @@ -28,7 +28,8 @@ from ansys.fluent.parametric import ParametricProject, ParametricStudy -def test_parametric_workflow(): +def test_parametric_workflow(monkeypatch: pytest.MonkeyPatch): + monkeypatch.setenv("PYFLUENT_CONTAINER_MOUNT_PATH", pyfluent.EXAMPLES_PATH) ############################################################################ # Launch Fluent in 3D and double precision @@ -50,11 +51,11 @@ def test_parametric_workflow(): ############################################################################ # Read the hopper/mixer case - import_filename = examples.download_file( - "Static_Mixer_main.cas.h5", "pyfluent/static_mixer" + import_filepath = examples.download_file( + "Static_Mixer_main.cas.h5", "pyfluent/static_mixer", return_only_filename=False ) - solver_session.tui.file.read_case(import_filename) + solver_session.tui.file.read_case(import_filepath) ############################################################################ # Set number of iterations to 100