From d11e8cea3bdf16ffcf89d97b7eb653df75542f6d Mon Sep 17 00:00:00 2001 From: dkunhamb Date: Wed, 17 Jun 2026 16:00:05 -0500 Subject: [PATCH 1/4] fix(pyvista): auto-detect Jupyter kernel to avoid blank trame renders --- pyproject.toml | 2 +- .../backends/pyvista/pyvista_interface.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d1286da06..03bdbddc6 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 8455b0fee..b207f9c06 100644 --- a/src/ansys/tools/visualization_interface/backends/pyvista/pyvista_interface.py +++ b/src/ansys/tools/visualization_interface/backends/pyvista/pyvista_interface.py @@ -465,6 +465,19 @@ 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 static 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 = "static" + except Exception: + pass # Enabling anti-aliasing by default on scene self.scene.enable_anti_aliasing("ssaa") From ca49b2dbc765f2a8decef84715e5ca2736e42051 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Wed, 17 Jun 2026 21:03:25 +0000 Subject: [PATCH 2/4] chore: adding changelog file 548.fixed.md [dependabot-skip] --- doc/changelog.d/548.fixed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog.d/548.fixed.md 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 From 0e73a62e6c1ce11bea07e16e0f617840194e6294 Mon Sep 17 00:00:00 2001 From: dkunhamb Date: Wed, 17 Jun 2026 16:03:30 -0500 Subject: [PATCH 3/4] update contributors --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) 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) From c6913a3ea5cbe4907f5f7a48eedda918cb919436 Mon Sep 17 00:00:00 2001 From: Alex Fernandez Date: Fri, 19 Jun 2026 16:22:54 +0200 Subject: [PATCH 4/4] fix: Default to HTML jupyter backend --- .../backends/pyvista/pyvista_interface.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 b207f9c06..ac589d179 100644 --- a/src/ansys/tools/visualization_interface/backends/pyvista/pyvista_interface.py +++ b/src/ansys/tools/visualization_interface/backends/pyvista/pyvista_interface.py @@ -466,7 +466,7 @@ def show( 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 static backend. + # 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. @@ -475,7 +475,7 @@ def show( _ip = get_ipython() if _ip is not None and "IPKernelApp" in _ip.config: - jupyter_backend = "static" + jupyter_backend = "html" except Exception: pass