From d4a3791a0dd575882b268463a50b87fba6abbb17 Mon Sep 17 00:00:00 2001 From: German Date: Tue, 19 Sep 2023 10:35:25 +0200 Subject: [PATCH 01/18] Changing configuration --- doc/source/conf.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/source/conf.py b/doc/source/conf.py index 9430456524..df6821d5bf 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -5,10 +5,13 @@ from ansys_sphinx_theme import ansys_favicon, get_version_match, pyansys_logo_black import numpy as np +import plotly.io as pio import pyvista from sphinx.application import Sphinx from sphinx_gallery.sorting import FileNameSortKey +pio.renderers.default = "sphinx_gallery" + from ansys.mapdl import core as pymapdl from ansys.mapdl.core import __version__ from ansys.mapdl.core.docs import linkcode_resolve From 2eceac81b24276be494955109fb852471e9df3e1 Mon Sep 17 00:00:00 2001 From: German Date: Tue, 19 Sep 2023 10:53:20 +0200 Subject: [PATCH 02/18] Using plotly in gallery example --- .../00-mapdl-examples/2d_plate_with_a_hole.py | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/examples/00-mapdl-examples/2d_plate_with_a_hole.py b/examples/00-mapdl-examples/2d_plate_with_a_hole.py index 8b44116207..7ad1934d2f 100644 --- a/examples/00-mapdl-examples/2d_plate_with_a_hole.py +++ b/examples/00-mapdl-examples/2d_plate_with_a_hole.py @@ -12,8 +12,8 @@ """ # sphinx_gallery_thumbnail_number = 3 -import matplotlib.pyplot as plt import numpy as np +import plotly.graph_objects as go from ansys.mapdl.core import launch_mapdl @@ -373,12 +373,24 @@ def compute_stress_con(ratio): # where ratio is (d/h) k_t_anl = 3 - 3.14 * ratios + 3.667 * ratios**2 - 1.527 * ratios**3 -plt.plot(ratios, k_t_anl, label=r"$K_t$ Analytical") -plt.plot(ratios, k_t_exp, label=r"$K_t$ ANSYS") -plt.legend() -plt.xlabel("Ratio of Hole Diameter to Width of Plate") -plt.ylabel("Stress Concentration") -plt.show() + +# Create traces +fig = go.Figure() +fig.add_trace( + go.Scatter(x=ratios, y=k_t_anl, mode="lines", name=r"$K_t \text{ Analytical}$") +) +fig.add_trace( + go.Scatter(x=ratios, y=k_t_exp, mode="lines+markers", name=r"$K_t \text{ ANSYS}$") +) + +fig.update_layout( + title="Analytical Comparison", + xaxis_title="Ratio of Hole Diameter to Width of Plate", + yaxis_title="Stress Concentration", +) + +fig + ############################################################################### # Stop mapdl From 887ac036755c8dcc6879da667e8cc4061739f1b3 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Tue, 15 Oct 2024 09:03:24 +0000 Subject: [PATCH 03/18] chore: adding changelog file 2346.documentation.md [dependabot-skip] --- doc/changelog.d/2346.documentation.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog.d/2346.documentation.md diff --git a/doc/changelog.d/2346.documentation.md b/doc/changelog.d/2346.documentation.md new file mode 100644 index 0000000000..7992ce3ebf --- /dev/null +++ b/doc/changelog.d/2346.documentation.md @@ -0,0 +1 @@ +Adding plottly support to gallery examples \ No newline at end of file From dbb35164541f605c9bd7349bb7c2d277a9a0e0a0 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Mon, 25 Nov 2024 13:51:04 +0100 Subject: [PATCH 04/18] test: using jorge's suggestion --- doc/source/conf.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index cad9985e8c..0b383c9124 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -10,6 +10,7 @@ from ansys_sphinx_theme import ansys_favicon, get_version_match import numpy as np import plotly.io as pio +from plotly.io._sg_scraper import plotly_sg_scraper import pyvista from sphinx.application import Sphinx from sphinx.util import logging @@ -273,7 +274,11 @@ "backreferences_dir": None, # Modules for which function level galleries are created. In "doc_module": "ansys-mapdl-core", - "image_scrapers": ("pyvista", "matplotlib"), + "image_scrapers": ( + "pyvista", + "matplotlib", + plotly_sg_scraper, + ), "ignore_pattern": "flycheck*", "thumbnail_size": (350, 350), "remove_config_comments": True, From 37653f3eeccbcc826d7e22e829dbda8f0869a7d6 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Mon, 17 Mar 2025 18:22:05 +0000 Subject: [PATCH 05/18] chore: adding changelog file 2346.documentation.md [dependabot-skip] --- doc/changelog.d/2346.documentation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog.d/2346.documentation.md b/doc/changelog.d/2346.documentation.md index 7992ce3ebf..67e5fbef3d 100644 --- a/doc/changelog.d/2346.documentation.md +++ b/doc/changelog.d/2346.documentation.md @@ -1 +1 @@ -Adding plottly support to gallery examples \ No newline at end of file +docs: adding plottly support to gallery examples \ No newline at end of file From 123f01b6deed5aa328d5369a2f7f63273ab92764 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Mon, 17 Mar 2025 19:44:48 +0100 Subject: [PATCH 06/18] build: install ansys-sphinx-theme from specific branch in documentation workflow --- .github/workflows/doc-build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index bfac80fa18..04ccf9c2dc 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -177,6 +177,11 @@ jobs: sudo apt-get update sudo apt-get install -y poppler-utils + - name: Install ansys-sphinx-theme branch + shell: bash + run: | + pip install git+https://github.com/ansys/ansys-sphinx-theme.git@feat/plotly + - name: "Build documentation" shell: bash run: | From babac0d41a4f98a3240003eb706d2138788dd24b Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Tue, 18 Mar 2025 09:00:06 +0100 Subject: [PATCH 07/18] test: temporory disable linkcode --- doc/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 940464673f..59d9ccc2e8 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -106,7 +106,7 @@ "sphinx_gallery.gen_gallery", "sphinxemoji.sphinxemoji", "sphinx.ext.graphviz", - "ansys_sphinx_theme.extension.linkcode", + # "ansys_sphinx_theme.extension.linkcode", "sphinx.ext.mathjax", ] From abbcdf3865812cd69125abe08d20370b3def2498 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Tue, 18 Mar 2025 11:49:03 +0100 Subject: [PATCH 08/18] test: plotly version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 52dd76cf38..1934272ab9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -89,7 +89,7 @@ doc = [ "nbformat==5.10.4", "numpydoc==1.8.0", "pandas==2.2.3", - "plotly==6.0.0", + "plotly==5.24.1", "pyiges[full]==0.3.1", "pypandoc==1.15", "pytest-sphinx==0.6.3", From 3c5c2da6ef6f6ea6c0844928379e8bf290853616 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Tue, 18 Mar 2025 14:26:27 +0100 Subject: [PATCH 09/18] fix: revert changes --- doc/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 59d9ccc2e8..940464673f 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -106,7 +106,7 @@ "sphinx_gallery.gen_gallery", "sphinxemoji.sphinxemoji", "sphinx.ext.graphviz", - # "ansys_sphinx_theme.extension.linkcode", + "ansys_sphinx_theme.extension.linkcode", "sphinx.ext.mathjax", ] From fa454215a60ec5be84c91be1e2b5566b3cdb821b Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Wed, 19 Mar 2025 09:44:04 +0100 Subject: [PATCH 10/18] fix: add js in conf.py file --- doc/source/conf.py | 2 ++ pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 940464673f..08a138d243 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -349,6 +349,8 @@ "mapdl_commands/index": [], } +html_js_files = ["https://cdn.plot.ly/plotly-3.0.1.min.js"] + # -- Options for HTMLHelp output --------------------------------------------- # Output file base name for HTML help builder. diff --git a/pyproject.toml b/pyproject.toml index 1934272ab9..9a782ed1dd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -89,7 +89,7 @@ doc = [ "nbformat==5.10.4", "numpydoc==1.8.0", "pandas==2.2.3", - "plotly==5.24.1", + "plotly==6.0.1", "pyiges[full]==0.3.1", "pypandoc==1.15", "pytest-sphinx==0.6.3", From 3b3138e8b799a40fabfb4e1b4777d5255dee32e3 Mon Sep 17 00:00:00 2001 From: Revathy Venugopal <104772255+Revathyvenugopal162@users.noreply.github.com> Date: Wed, 26 Mar 2025 16:18:40 +0100 Subject: [PATCH 11/18] Update .github/workflows/doc-build.yml --- .github/workflows/doc-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index a91422f6c9..b5675a0c9d 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -180,7 +180,7 @@ jobs: - name: Install ansys-sphinx-theme branch shell: bash run: | - pip install git+https://github.com/ansys/ansys-sphinx-theme.git@feat/plotly + pip install git+https://github.com/ansys/ansys-sphinx-theme.git@main - name: "Build documentation" shell: bash From 973c74675c5bb04383dd7edcee4703a69a9626f5 Mon Sep 17 00:00:00 2001 From: Revathy Venugopal <104772255+Revathyvenugopal162@users.noreply.github.com> Date: Wed, 26 Mar 2025 16:55:33 +0100 Subject: [PATCH 12/18] Update .github/workflows/doc-build.yml --- .github/workflows/doc-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index b5675a0c9d..603e35ecbc 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -180,7 +180,7 @@ jobs: - name: Install ansys-sphinx-theme branch shell: bash run: | - pip install git+https://github.com/ansys/ansys-sphinx-theme.git@main + pip install git+https://github.com/ansys/ansys-sphinx-theme.git@fix/quarto-std - name: "Build documentation" shell: bash From 85223091c85efa2ede218767094ccf45d3d83ce6 Mon Sep 17 00:00:00 2001 From: Revathy Venugopal <104772255+Revathyvenugopal162@users.noreply.github.com> Date: Wed, 26 Mar 2025 17:36:00 +0100 Subject: [PATCH 13/18] Update .github/workflows/doc-build.yml --- .github/workflows/doc-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index 603e35ecbc..b5675a0c9d 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -180,7 +180,7 @@ jobs: - name: Install ansys-sphinx-theme branch shell: bash run: | - pip install git+https://github.com/ansys/ansys-sphinx-theme.git@fix/quarto-std + pip install git+https://github.com/ansys/ansys-sphinx-theme.git@main - name: "Build documentation" shell: bash From 3acb6a90feb7e0da97b1043651c5eac83176a33c Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 27 Mar 2025 10:15:07 +0100 Subject: [PATCH 14/18] fix: update the theme version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9a782ed1dd..fc84e759ba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,7 +77,7 @@ tests = [ doc = [ "ansys-dpf-core==0.10.1", "ansys-mapdl-reader==0.54.2", - "ansys-sphinx-theme==1.3.2", + "ansys-sphinx-theme==1.4.0", "ansys-tools-visualization-interface==0.8.3", "grpcio==1.70.0", "imageio-ffmpeg==0.6.0", From 3931b022ba6cb9484a1248763c01f5166763d506 Mon Sep 17 00:00:00 2001 From: Revathy Venugopal <104772255+Revathyvenugopal162@users.noreply.github.com> Date: Thu, 27 Mar 2025 10:16:50 +0100 Subject: [PATCH 15/18] Update .github/workflows/doc-build.yml --- .github/workflows/doc-build.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index b5675a0c9d..38c76276b3 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -177,10 +177,6 @@ jobs: sudo apt-get update sudo apt-get install -y poppler-utils - - name: Install ansys-sphinx-theme branch - shell: bash - run: | - pip install git+https://github.com/ansys/ansys-sphinx-theme.git@main - name: "Build documentation" shell: bash From 15243acef81b1b342f86ea45c6b38ec45c0c9679 Mon Sep 17 00:00:00 2001 From: Revathy Venugopal <104772255+Revathyvenugopal162@users.noreply.github.com> Date: Thu, 27 Mar 2025 11:12:56 +0100 Subject: [PATCH 16/18] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index fc84e759ba..c53fb69e2a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,7 +77,7 @@ tests = [ doc = [ "ansys-dpf-core==0.10.1", "ansys-mapdl-reader==0.54.2", - "ansys-sphinx-theme==1.4.0", + "ansys-sphinx-theme @ git+https://github.com/ansys/ansys-sphinx-theme.git@fix/quarto-logging", "ansys-tools-visualization-interface==0.8.3", "grpcio==1.70.0", "imageio-ffmpeg==0.6.0", From 1bd7dfdbf642da5842d1a6224f244c6e7f2d68e4 Mon Sep 17 00:00:00 2001 From: Revathy Venugopal <104772255+Revathyvenugopal162@users.noreply.github.com> Date: Thu, 27 Mar 2025 11:34:33 +0100 Subject: [PATCH 17/18] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c53fb69e2a..7351ef1f15 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,7 +77,7 @@ tests = [ doc = [ "ansys-dpf-core==0.10.1", "ansys-mapdl-reader==0.54.2", - "ansys-sphinx-theme @ git+https://github.com/ansys/ansys-sphinx-theme.git@fix/quarto-logging", + "ansys-sphinx-theme==1.4.1", "ansys-tools-visualization-interface==0.8.3", "grpcio==1.70.0", "imageio-ffmpeg==0.6.0", From 4314e8246fa8d2ff037b579a1adcc3c5e767576b Mon Sep 17 00:00:00 2001 From: Revathy Venugopal <104772255+Revathyvenugopal162@users.noreply.github.com> Date: Thu, 27 Mar 2025 12:01:08 +0100 Subject: [PATCH 18/18] Update .github/workflows/doc-build.yml --- .github/workflows/doc-build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index 38c76276b3..f8de458f81 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -177,7 +177,6 @@ jobs: sudo apt-get update sudo apt-get install -y poppler-utils - - name: "Build documentation" shell: bash run: |