From 951b4553fcb10225090d7305eb679e77a89023e7 Mon Sep 17 00:00:00 2001 From: PProfizi Date: Mon, 17 Feb 2025 17:23:52 +0100 Subject: [PATCH 1/4] Fix workflow.view() --- src/ansys/dpf/core/workflow.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ansys/dpf/core/workflow.py b/src/ansys/dpf/core/workflow.py index 7c265802190..c4db7ddea8f 100644 --- a/src/ansys/dpf/core/workflow.py +++ b/src/ansys/dpf/core/workflow.py @@ -934,10 +934,10 @@ def view( if save_as: image_path = Path(save_as) - dot_path = image_path.parent / image_path.stem / ".dot" + dot_path = image_path.parent / f"{image_path.stem}.dot" else: image_path = Path.cwd() / f"{name}.png" - dot_path = image_path.parent / image_path.stem / ".dot" + dot_path = image_path.parent / f"{image_path.stem}.dot" # Create graphviz file of workflow self.to_graphviz(dot_path) From 51be45827ddf605dc791bf21889d42b7607e9c58 Mon Sep 17 00:00:00 2001 From: PProfizi Date: Wed, 19 Feb 2025 10:12:52 +0100 Subject: [PATCH 2/4] Add graphviz to requirements_test.txt --- requirements/requirements_test.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements/requirements_test.txt b/requirements/requirements_test.txt index 1238fc86b81..f37485a587d 100644 --- a/requirements/requirements_test.txt +++ b/requirements/requirements_test.txt @@ -1,5 +1,6 @@ ansys-platform-instancemanagement==1.1.2 coverage==7.6.11 +graphviz==0.20.1 imageio==2.36.0 imageio-ffmpeg==0.6.0 pytest==8.3.4 From bd515a990c0a6c266178b8d3d0ea8dd2db59a5d8 Mon Sep 17 00:00:00 2001 From: PProfizi Date: Wed, 19 Feb 2025 10:16:31 +0100 Subject: [PATCH 3/4] Install graphviz in test pipelines --- .github/workflows/test_docker.yml | 3 +++ .github/workflows/tests.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/test_docker.yml b/.github/workflows/test_docker.yml index fc170438a62..9b8c8daff2d 100644 --- a/.github/workflows/test_docker.yml +++ b/.github/workflows/test_docker.yml @@ -51,6 +51,9 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: "Setup Graphviz" + uses: ts-graphviz/setup-graphviz@v2 + - name: "Install requirements" run: pip install -r requirements/requirements_build.txt diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f838c45f5f9..a8d38677ec5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -114,6 +114,9 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: "Setup Graphviz" + uses: ts-graphviz/setup-graphviz@v2 + - name: "Update pip to the latest version and install tox" shell: pwsh run: | From aa12c8543a17f1909f21c8e03c1844937ecf0788 Mon Sep 17 00:00:00 2001 From: PProfizi Date: Wed, 19 Feb 2025 11:48:04 +0100 Subject: [PATCH 4/4] Fix skip message in test_workflow_view --- tests/test_workflow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_workflow.py b/tests/test_workflow.py index 1a89d98c6f0..1bd7c9d48f4 100644 --- a/tests/test_workflow.py +++ b/tests/test_workflow.py @@ -63,7 +63,7 @@ def remove_files(): request.addfinalizer(remove_files) -@pytest.mark.skipif(not HAS_GRAPHVIZ, reason="Please install pyvista") +@pytest.mark.skipif(not HAS_GRAPHVIZ, reason="Please install graphviz") def test_workflow_view(server_in_process, remove_dot_file): pre_wf = dpf.core.Workflow(server=server_in_process) pre_op = dpf.core.operators.utility.forward(server=server_in_process)