From 482bb756b61da584ee2c2788bc0595cbb4291744 Mon Sep 17 00:00:00 2001 From: Andreas Dutzler Date: Mon, 7 Aug 2023 12:21:10 +0200 Subject: [PATCH 1/2] Start virtual framebuffer for notebook plotting of views --- CHANGELOG.md | 5 +++++ src/felupe/tools/_plot.py | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd09d9e4..9110138f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file. The format ## [Unreleased] +## [7.6.1] - 2023-08-07 + +### Changed +- Start a virtual framebuffer in Jupyter notebook plotting of `View.plot(notebook=True)`. Note: Requires `sudo apt-get install xvfb`. + ## [7.6.0] - 2023-08-06 ### Added diff --git a/src/felupe/tools/_plot.py b/src/felupe/tools/_plot.py index 70a5e7c6..fa9e0dba 100644 --- a/src/felupe/tools/_plot.py +++ b/src/felupe/tools/_plot.py @@ -16,6 +16,8 @@ along with FElupe. If not, see . """ +import os + import numpy as np from ..math import eigvalsh, tovoigt @@ -112,6 +114,12 @@ def plot( if theme is not None: pv.set_plot_theme(theme) + # try to start a virtual framebuffer on linux + # requires ``sudo apt-get install xvfb`` + if notebook: + if os.name == "posix": + pv.start_xvfb() + if plotter is None: plotter = pv.Plotter(off_screen=off_screen, notebook=notebook) From 70f181729f92777698fe8729e957d337b64179b9 Mon Sep 17 00:00:00 2001 From: Andreas Dutzler Date: Mon, 7 Aug 2023 12:26:07 +0200 Subject: [PATCH 2/2] Update __about__.py --- src/felupe/__about__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/felupe/__about__.py b/src/felupe/__about__.py index 7ffab095..2f2df66f 100644 --- a/src/felupe/__about__.py +++ b/src/felupe/__about__.py @@ -1 +1 @@ -__version__ = "7.6.0" +__version__ = "7.6.1"