Skip to content

Commit 1fa2e37

Browse files
committed
CI fixed
1 parent 30eab74 commit 1fa2e37

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/tensor_network_viz/_interaction/controller.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import matplotlib.pyplot as plt
99
import numpy as np
1010
from matplotlib.axes import Axes
11+
from matplotlib.backend_bases import NonGuiException
1112
from matplotlib.figure import Figure
1213
from matplotlib.widgets import CheckButtons, RadioButtons
1314
from mpl_toolkits.mplot3d.axes3d import Axes3D
@@ -79,12 +80,12 @@ def _reveal_auxiliary_figure(figure: Figure) -> None:
7980
manager = getattr(figure.canvas, "manager", None)
8081
manager_show = getattr(manager, "show", None)
8182
if callable(manager_show):
82-
with suppress(AttributeError, RuntimeError, TypeError, ValueError):
83+
with suppress(AttributeError, NonGuiException, RuntimeError, TypeError, ValueError):
8384
manager_show()
8485
else:
8586
figure_show = getattr(figure, "show", None)
8687
if callable(figure_show):
87-
with suppress(AttributeError, RuntimeError, TypeError, ValueError):
88+
with suppress(AttributeError, NonGuiException, RuntimeError, TypeError, ValueError):
8889
figure_show()
8990
draw_idle = getattr(figure.canvas, "draw_idle", None)
9091
if callable(draw_idle):

src/tensor_network_viz/_interaction/scheme.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class _ContractionSchemeBundle:
3030
artists_by_step: list[Artist | None] | None = None
3131
scheme_aabb: list[tuple[float, float, float, float, float, float] | None] | None = None
3232
metrics_row: tuple[Any | None, ...] | None = None
33-
step_details: tuple[str | None] | None = None
33+
step_details: tuple[str | None, ...] | None = None
3434
viewer: Any = None
3535
bounds_2d: tuple[float, float, float, float] | None = None
3636
bounds_3d: tuple[float, float, float, float, float, float] | None = None

tests/test_interaction_state.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
from __future__ import annotations
22

3+
from typing import cast
4+
35
import matplotlib
46

57
matplotlib.use("Agg")
68

79
import matplotlib.pyplot as plt
810
from matplotlib.text import Text
911

12+
from tensor_network_viz._core.draw.scene_state import _InteractiveSceneState
1013
from tensor_network_viz._interaction.bridge import (
1114
clear_contraction_controls,
1215
clear_hover_annotation,
@@ -48,7 +51,7 @@ def test_bridge_round_trips_matplotlib_attrs() -> None:
4851
set_reserved_bottom(fig, 0.3)
4952
assert get_reserved_bottom(fig) == 0.3
5053

51-
scene = object()
54+
scene = cast(_InteractiveSceneState, object())
5255
controls = object()
5356
viewer = object()
5457
interactive_controls = object()

0 commit comments

Comments
 (0)