Skip to content

Commit ee53640

Browse files
authored
Add storage dimensions for eGrabber tests. (#196)
Now that the eGrabber runner is working again, we need to update the tests to reflect changes in the required settings when writing to Zarr.
1 parent b361ee9 commit ee53640

File tree

1 file changed

+30
-8
lines changed

1 file changed

+30
-8
lines changed

tests/test_egrabber.py

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,12 @@
77
from acquire.acquire import Trigger
88

99

10-
@pytest.fixture(scope="module")
11-
def _runtime():
10+
@pytest.fixture(scope="function")
11+
def runtime():
1212
runtime = acquire.Runtime()
1313
yield runtime
1414

1515

16-
@pytest.fixture(scope="function")
17-
def runtime(_runtime: acquire.Runtime):
18-
yield _runtime
19-
_runtime.set_configuration(acquire.Properties())
20-
21-
2216
def test_vieworks_camera_is_present(runtime: acquire.Runtime):
2317
dm = runtime.device_manager()
2418
assert dm.select(DeviceKind.Camera, "VIEWORKS.*")
@@ -49,6 +43,34 @@ def test_vieworks_stream(
4943
p.video[0].storage.settings.pixel_scale_um = (0.2, 0.2)
5044
p.video[0].max_frame_count = 10
5145

46+
# configure storage dimensions
47+
dimension_x = acquire.StorageDimension(
48+
name="x",
49+
kind="Space",
50+
array_size_px=p.video[0].camera.settings.shape[0],
51+
chunk_size_px=p.video[0].camera.settings.shape[0] // 2,
52+
)
53+
54+
dimension_y = acquire.StorageDimension(
55+
name="y",
56+
kind="Space",
57+
array_size_px=p.video[0].camera.settings.shape[1],
58+
chunk_size_px=p.video[0].camera.settings.shape[1] // 2,
59+
)
60+
61+
dimension_t = acquire.StorageDimension(
62+
name="t",
63+
kind="Time",
64+
array_size_px=0,
65+
chunk_size_px=p.video[0].max_frame_count,
66+
)
67+
68+
p.video[0].storage.settings.acquisition_dimensions = [
69+
dimension_x,
70+
dimension_y,
71+
dimension_t,
72+
]
73+
5274
p = runtime.set_configuration(p)
5375

5476
logging.info(pprint.pformat(p.dict()))

0 commit comments

Comments
 (0)