Skip to content

Commit

Permalink
Persistent storage (#126)
Browse files Browse the repository at this point in the history
- Updates acquire-core-libs and acquire-video-runtime to latest on main
- Do not start the runtime in `test_basic.test_storage_capabilities()`
(no longer needed)
- Bump the patch version to 0.2.1 (behavior change)
- Update acquire-driver-zarr to 0.1.7 (fix around start / stop behavior
with thread pool)
- 🚨🚨 **Potentially controversial decision:** 🚨🚨 Scope `runtime` to
"function" (as opposed to "module") for `test_basic.py` and
`test_zarr.py`.
  • Loading branch information
aliddell authored Dec 12, 2023
1 parent 832233a commit b38e2bd
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "acquire-imaging"
authors = ["Nathan Clack <[email protected]>"]
version = "0.2.0"
version = "0.2.1"
edition = "2021"

[lib]
Expand Down
2 changes: 1 addition & 1 deletion drivers.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"acquire-driver-common": "0.1.5",
"acquire-driver-zarr": "0.1.6",
"acquire-driver-zarr": "0.1.7",
"acquire-driver-egrabber": "0.1.4",
"acquire-driver-hdcam": "0.1.6",
"acquire-driver-spinnaker": "0.1.1"
Expand Down
20 changes: 3 additions & 17 deletions tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,10 @@
import tifffile


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


# FIXME (aliddell): this should be module scoped, but the runtime is leaky
@pytest.fixture(scope="function")
def runtime(_runtime: Runtime):
yield _runtime
_runtime.set_configuration(acquire.Properties())
def runtime():
yield acquire.Runtime()


def test_set():
Expand Down Expand Up @@ -527,7 +521,6 @@ def test_simulated_camera_capabilities(
)
def test_storage_capabilities(
runtime: Runtime,
request: pytest.FixtureRequest,
descriptor: str,
extension: str,
chunking: Optional[Dict[str, Any]],
Expand All @@ -539,20 +532,13 @@ def test_storage_capabilities(
p.video[0].camera.identifier = dm.select(DeviceKind.Camera, ".*empty")
p.video[0].storage.identifier = dm.select(DeviceKind.Storage, descriptor)

# FIXME (aliddell): hack to get the storage capabilities to be populated
p.video[0].storage.settings.filename = f"{request.node.name}.{extension}"

p.video[0].storage.settings.external_metadata_json = json.dumps(
{"hello": "world"}
) # for tiff-json
p.video[0].max_frame_count = 1000
runtime.set_configuration(p)

# FIXME (aliddell): hack to get the storage capabilities to be populated
runtime.start()
c = runtime.get_capabilities()
# FIXME (aliddell): hack to get the storage capabilities to be populated
runtime.abort()
storage = c.video[0].storage

chunk_dims_px = storage.chunk_dims_px
Expand Down
12 changes: 3 additions & 9 deletions tests/test_zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,10 @@
from acquire import Runtime, DeviceKind


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


# FIXME (aliddell): this should be module scoped, but the runtime is leaky
@pytest.fixture(scope="function")
def runtime(_runtime: acquire.Runtime):
yield _runtime
_runtime.set_configuration(acquire.Properties())
def runtime():
yield acquire.Runtime()


def test_write_external_metadata_to_zarr(
Expand Down

0 comments on commit b38e2bd

Please sign in to comment.