Skip to content

Commit

Permalink
Add storage dimensions for eGrabber tests. (#196)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aliddell authored May 28, 2024
1 parent b361ee9 commit ee53640
Showing 1 changed file with 30 additions and 8 deletions.
38 changes: 30 additions & 8 deletions tests/test_egrabber.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,12 @@
from acquire.acquire import Trigger


@pytest.fixture(scope="module")
def _runtime():
@pytest.fixture(scope="function")
def runtime():
runtime = acquire.Runtime()
yield runtime


@pytest.fixture(scope="function")
def runtime(_runtime: acquire.Runtime):
yield _runtime
_runtime.set_configuration(acquire.Properties())


def test_vieworks_camera_is_present(runtime: acquire.Runtime):
dm = runtime.device_manager()
assert dm.select(DeviceKind.Camera, "VIEWORKS.*")
Expand Down Expand Up @@ -49,6 +43,34 @@ def test_vieworks_stream(
p.video[0].storage.settings.pixel_scale_um = (0.2, 0.2)
p.video[0].max_frame_count = 10

# configure storage dimensions
dimension_x = acquire.StorageDimension(
name="x",
kind="Space",
array_size_px=p.video[0].camera.settings.shape[0],
chunk_size_px=p.video[0].camera.settings.shape[0] // 2,
)

dimension_y = acquire.StorageDimension(
name="y",
kind="Space",
array_size_px=p.video[0].camera.settings.shape[1],
chunk_size_px=p.video[0].camera.settings.shape[1] // 2,
)

dimension_t = acquire.StorageDimension(
name="t",
kind="Time",
array_size_px=0,
chunk_size_px=p.video[0].max_frame_count,
)

p.video[0].storage.settings.acquisition_dimensions = [
dimension_x,
dimension_y,
dimension_t,
]

p = runtime.set_configuration(p)

logging.info(pprint.pformat(p.dict()))
Expand Down

0 comments on commit ee53640

Please sign in to comment.