Skip to content

Commit 4f9ea3c

Browse files
fix: Uninitialized variable in PyVistaBackendInterface
1 parent 2b90991 commit 4f9ea3c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/ansys/tools/visualization_interface/backends/pyvista/pyvista.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ def __init__(
131131
# Map that relates PyVista actors with PyAnsys objects
132132
self._object_to_actors_map = {}
133133

134+
self._edge_actors_map: Dict[pv.Actor, EdgePlot] = {}
135+
134136
# PyVista plotter
135137
self._pl = None
136138

tests/test_generic_plotter.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import pytest
2828
import pyvista as pv
2929

30-
from ansys.tools.visualization_interface import ClipPlane, MeshObjectPlot, Plotter
30+
from ansys.tools.visualization_interface import ClipPlane, MeshObjectPlot, EdgePlot, Plotter
3131
from ansys.tools.visualization_interface.backends.pyvista import PyVistaBackend
3232
from ansys.tools.visualization_interface.backends.pyvista.picker import Picker
3333

@@ -93,7 +93,9 @@ def test_plotter_add_structured_grid():
9393
def test_plotter_add_custom():
9494
"""Adds a MeshObjectPlot object to the plotter."""
9595
sphere = pv.Sphere()
96-
custom = MeshObjectPlot(CustomTestClass("myname"), sphere)
96+
edge = pv.Cube((0, 1, 0))
97+
custom_edge = EdgePlot(CustomTestClass("myname_edge"), edge)
98+
custom = MeshObjectPlot(CustomTestClass("myname"), sphere, edges=[custom_edge])
9799
pl = Plotter()
98100
pl.plot(custom)
99101
pl.show()

0 commit comments

Comments
 (0)