Skip to content

Commit 25e7009

Browse files
fix: Typing
1 parent f182592 commit 25e7009

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

src/ansys/tools/visualization_interface/types/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@
2020
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
# SOFTWARE.
2222
"""Provides custom types."""
23-
from .mesh_object_plot import MeshObjectPlot # noqa: F401

src/ansys/tools/visualization_interface/types/edge_plot.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@
2424

2525
from typing import TYPE_CHECKING, Any, Union
2626

27-
from plotly.graph_objects import Mesh3d
2827
import pyvista as pv
2928

3029
if TYPE_CHECKING:
30+
from plotly.graph_objects import Mesh3d
31+
3132
from ansys.tools.visualization_interface.types.mesh_object_plot import MeshObjectPlot
3233

3334
class EdgePlot:
@@ -44,7 +45,7 @@ class EdgePlot:
4445
4546
"""
4647

47-
def __init__(self, actor: Union[pv.Actor, Mesh3d], edge_object: Any, parent: Any = None) -> None:
48+
def __init__(self, actor: Union[pv.Actor, "Mesh3d"], edge_object: Any, parent: Any = None) -> None:
4849
"""Initialize ``EdgePlot`` variables."""
4950
self._actor = actor
5051
self._object = edge_object

src/ansys/tools/visualization_interface/types/mesh_object_plot.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,22 @@
2222
"""Provides the ``MeshObjectPlot`` class."""
2323

2424

25-
from typing import Any, List, Type, Union
25+
from typing import TYPE_CHECKING, Any, List, Type, Union
2626

27-
from plotly.graph_objects import Mesh3d
2827
import pyvista as pv
2928

3029
from ansys.tools.visualization_interface.types.edge_plot import EdgePlot
3130

31+
if TYPE_CHECKING:
32+
from plotly.graph_objects import Mesh3d
3233

3334
class MeshObjectPlot:
3435
"""Relates a custom object with a mesh, provided by the consumer library."""
3536

3637
def __init__(
3738
self,
3839
custom_object: Any,
39-
mesh: Union[pv.PolyData, pv.MultiBlock, Mesh3d],
40+
mesh: Union[pv.PolyData, pv.MultiBlock, "Mesh3d"],
4041
actor: pv.Actor = None,
4142
edges: List[EdgePlot] = None,
4243
) -> None:
@@ -64,7 +65,7 @@ def __init__(
6465
self._edges = edges
6566

6667
@property
67-
def mesh(self) -> Union[pv.PolyData, pv.MultiBlock, Mesh3d]:
68+
def mesh(self) -> Union[pv.PolyData, pv.MultiBlock, "Mesh3d"]:
6869
"""Mesh of the object in PyVista format.
6970
7071
Returns
@@ -76,7 +77,7 @@ def mesh(self) -> Union[pv.PolyData, pv.MultiBlock, Mesh3d]:
7677
return self._mesh
7778

7879
@mesh.setter
79-
def mesh(self, mesh: Union[pv.PolyData, pv.MultiBlock, Mesh3d]):
80+
def mesh(self, mesh: Union[pv.PolyData, pv.MultiBlock, "Mesh3d"]):
8081
"""Set the mesh of the object in PyVista format.
8182
8283
Parameters

0 commit comments

Comments
 (0)