From 046b0f29afcc7cd0f19707ecaf4fa2cb5cb164dc Mon Sep 17 00:00:00 2001 From: Mathis Chenuet <9201969+artemisart@users.noreply.github.com> Date: Tue, 3 Jun 2025 20:42:59 +0200 Subject: [PATCH 1/2] fix: make graphviz optional --- mandala/viz.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mandala/viz.py b/mandala/viz.py index f78ea34..5694197 100644 --- a/mandala/viz.py +++ b/mandala/viz.py @@ -8,7 +8,6 @@ import subprocess import webbrowser from typing import Literal -from graphviz import Source from IPython import display if Config.has_pil: @@ -424,6 +423,8 @@ def write_output( webbrowser.open(str(output_path)) return elif show_how == "inline": + from graphviz import Source + src = Source(dot_string) display.display(src) elif show_how == "none": From 03655decd5a8d9565f957f4fd6fd119b46e13016 Mon Sep 17 00:00:00 2001 From: Mathis Chenuet <9201969+artemisart@users.noreply.github.com> Date: Tue, 3 Jun 2025 20:48:38 +0200 Subject: [PATCH 2/2] IPython as well --- mandala/viz.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mandala/viz.py b/mandala/viz.py index 5694197..782caaf 100644 --- a/mandala/viz.py +++ b/mandala/viz.py @@ -8,7 +8,6 @@ import subprocess import webbrowser from typing import Literal -from IPython import display if Config.has_pil: from PIL import Image @@ -424,6 +423,8 @@ def write_output( return elif show_how == "inline": from graphviz import Source + from IPython import display + src = Source(dot_string) display.display(src)