|
7 | 7 | from acquire.acquire import Trigger |
8 | 8 |
|
9 | 9 |
|
10 | | -@pytest.fixture(scope="module") |
11 | | -def _runtime(): |
| 10 | +@pytest.fixture(scope="function") |
| 11 | +def runtime(): |
12 | 12 | runtime = acquire.Runtime() |
13 | 13 | yield runtime |
14 | 14 |
|
15 | 15 |
|
16 | | -@pytest.fixture(scope="function") |
17 | | -def runtime(_runtime: acquire.Runtime): |
18 | | - yield _runtime |
19 | | - _runtime.set_configuration(acquire.Properties()) |
20 | | - |
21 | | - |
22 | 16 | def test_vieworks_camera_is_present(runtime: acquire.Runtime): |
23 | 17 | dm = runtime.device_manager() |
24 | 18 | assert dm.select(DeviceKind.Camera, "VIEWORKS.*") |
@@ -49,6 +43,34 @@ def test_vieworks_stream( |
49 | 43 | p.video[0].storage.settings.pixel_scale_um = (0.2, 0.2) |
50 | 44 | p.video[0].max_frame_count = 10 |
51 | 45 |
|
| 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 | + |
52 | 74 | p = runtime.set_configuration(p) |
53 | 75 |
|
54 | 76 | logging.info(pprint.pformat(p.dict())) |
|
0 commit comments