-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtest_bigimages.py
More file actions
42 lines (30 loc) · 908 Bytes
/
test_bigimages.py
File metadata and controls
42 lines (30 loc) · 908 Bytes
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
# -*- coding: utf-8 -*-
#
# Licensed under the terms of the BSD 3-Clause
# (see plotpy/LICENSE for details)
"""Test showing 10 big images"""
# guitest: show
import numpy as np
import pytest
from guidata.qthelpers import qt_app_context
from plotpy.builder import make
def imshow():
win = make.dialog(
toolbar=True, title="Displaying 10 big images test", size=(800, 600)
)
plot = win.manager.get_plot()
for i in range(10):
plot.add_item(make.image(compute_image(i)))
win.show()
return win
def compute_image(i, N=7500, M=1750):
if i % 2 == 0:
N, M = M, N
return (np.random.rand(N, M) * 65536).astype(np.int16)
@pytest.mark.skip(reason="Not relevant in automated test suite")
def test_bigimages():
"""Test Bigimages"""
with qt_app_context(exec_loop=True):
_persist_obj = imshow()
if __name__ == "__main__":
test_bigimages()