forked from pyvista/pyvista
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_ipy_tools.py
85 lines (69 loc) · 2.67 KB
/
test_ipy_tools.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import sys
import numpy as np
import pytest
import vtki
from vtki import QtInteractor, examples
from vtki.plotting import system_supports_plotting
try:
import PyQt5
has_pyqt5 = True
except:
has_pyqt5 = False
@pytest.mark.skipif(not system_supports_plotting(), reason="Requires system to support plotting")
@pytest.mark.skipif(not has_pyqt5, reason="requires pyqt5")
def test_ipy_scaled_plotter(qtbot):
data = examples.load_uniform()
p = vtki.ScaledPlotter(show=False)
p.add_mesh(data)
p.close()
@pytest.mark.skipif(not system_supports_plotting(), reason="Requires system to support plotting")
@pytest.mark.skipif(not has_pyqt5, reason="requires pyqt5")
def test_ipy_orthoganl_slicer(qtbot):
data = examples.load_uniform()
tool = vtki.OrthogonalSlicer(data, show=False)
g = tool.tool()
g.widget.update()
tool.plotter.close()
@pytest.mark.skipif(not system_supports_plotting(), reason="Requires system to support plotting")
@pytest.mark.skipif(not has_pyqt5, reason="requires pyqt5")
def test_ipy_many_slices_along_axis(qtbot):
data = examples.load_uniform()
tool = vtki.ManySlicesAlongAxis(data, show=False)
g = tool.tool()
g.widget.update()
tool.plotter.close()
@pytest.mark.skipif(not system_supports_plotting(), reason="Requires system to support plotting")
@pytest.mark.skipif(not has_pyqt5, reason="requires pyqt5")
def test_ipy_threshold(qtbot):
data = examples.load_uniform()
tool = vtki.Threshold(data, show=False)
g = tool.tool()
g.widget.update()
tool.plotter.close()
@pytest.mark.skipif(not system_supports_plotting(), reason="Requires system to support plotting")
@pytest.mark.skipif(not has_pyqt5, reason="requires pyqt5")
def test_ipy_clip(qtbot):
data = examples.load_uniform()
tool = vtki.Clip(data, show=False)
g = tool.tool()
g.widget.update()
tool.plotter.close()
@pytest.mark.skipif(not system_supports_plotting(), reason="Requires system to support plotting")
@pytest.mark.skipif(not has_pyqt5, reason="requires pyqt5")
def test_ipy_integrated(qtbot):
data = examples.load_uniform()
p = vtki.ScaledPlotter(show=False)
p.add_mesh(data)
slicer = vtki.OrthogonalSlicer(data, plotter=p)
many = vtki.ManySlicesAlongAxis(data, plotter=p)
thresher = vtki.Threshold(data, plotter=p)
clipper = vtki.Clip(data, plotter=p)
p.close()
@pytest.mark.skipif(not system_supports_plotting(), reason="Requires system to support plotting")
@pytest.mark.skipif(not has_pyqt5, reason="requires pyqt5")
def test_ipy_isocontour(qtbot):
data = examples.load_uniform()
tool = vtki.Isocontour(data, show=False)
g = tool.tool()
g.widget.update()
tool.plotter.close()