diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 1286dbedd..c47f647bb 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -49,8 +49,7 @@ jobs: python-version: ${{ env.MAIN_PYTHON_VERSION }} python-package-name: ${{ env.PACKAGE_NAME }} token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} - upload-reports: true - hide-log: false + - name: PyAnsys Vulnerability check (on dev mode) if: github.ref != 'refs/heads/main' @@ -61,6 +60,7 @@ jobs: token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} dev-mode: true + actions-security: name: Actions Security runs-on: ubuntu-latest diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 72e32aa00..2f3f0990e 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -7,6 +7,7 @@ ## Individual Contributors * [Abhishek Chitwar](https://github.com/abhishekchitwar) +* [Dipin](https://github.com/dipinknair) * [German](https://github.com/germa89) * [Jorge Martínez](https://github.com/jorgepiloto) * [Kathy Pippert](https://github.com/PipKat) diff --git a/doc/changelog.d/548.fixed.md b/doc/changelog.d/548.fixed.md new file mode 100644 index 000000000..5bda95820 --- /dev/null +++ b/doc/changelog.d/548.fixed.md @@ -0,0 +1 @@ +Fix: auto-detect Jupyter kernel to avoid blank trame renders diff --git a/doc/source/conf.py b/doc/source/conf.py index 46b538db2..7cabe69f6 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -224,6 +224,8 @@ "https://docs.pyvista.org/api/core/_autosummary/pyvista.MultiBlock.html#pyvista.MultiBlock", "https://docs.pyvista.org/api/core/_autosummary/pyvista.UnstructuredGrid.html#pyvista.UnstructuredGrid", "https://docs.pyvista.org/api/plotting/_autosummary/pyvista.Actor.html#pyvista.Actor", + " https://docs.pyvista.org/api/core/_autosummary/pyvista.StructuredGrid.html#pyvista.StructuredGrid", + "https://docs.pyvista.org/user-guide/jupyter/index.html", ] diff --git a/pyproject.toml b/pyproject.toml index 5d13e32ab..584553f0c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ansys-tools-visualization-interface" -version = "0.8.dev0" +version = "0.13.dev0" description = "A Python visualization interface for PyAnsys libraries" readme = "README.rst" requires-python = ">=3.10,<4" diff --git a/src/ansys/tools/visualization_interface/backends/pyvista/pyvista_interface.py b/src/ansys/tools/visualization_interface/backends/pyvista/pyvista_interface.py index 8ebc1deb5..3a661faed 100644 --- a/src/ansys/tools/visualization_interface/backends/pyvista/pyvista_interface.py +++ b/src/ansys/tools/visualization_interface/backends/pyvista/pyvista_interface.py @@ -466,6 +466,21 @@ def show( # Override Jupyter backend if building docs if viz_interface.USE_HTML_BACKEND: jupyter_backend = "html" + elif jupyter_backend is None: + # Auto-detect a Jupyter kernel and fall back to a safe html backend. + # Without this, PyVista defaults to "trame" (after installing + # pyvista[jupyter]), which spawns a local server and renders blank + # in VS Code / Spyder embedded notebooks. + try: + from IPython import get_ipython + + _ip = get_ipython() + if _ip is not None and "IPKernelApp" in _ip.config: + jupyter_backend = "html" + except Exception as exc: + logger.debug( + "Not in a Jupyter environment: %s", exc + ) # Enabling anti-aliasing by default on scene self.scene.enable_anti_aliasing("ssaa")