Skip to content

Commit b38e2bd

Browse files
authored
Persistent storage (#126)
- 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`.
1 parent 832233a commit b38e2bd

File tree

6 files changed

+10
-30
lines changed

6 files changed

+10
-30
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "acquire-imaging"
33
authors = ["Nathan Clack <[email protected]>"]
4-
version = "0.2.0"
4+
version = "0.2.1"
55
edition = "2021"
66

77
[lib]

drivers.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"acquire-driver-common": "0.1.5",
3-
"acquire-driver-zarr": "0.1.6",
3+
"acquire-driver-zarr": "0.1.7",
44
"acquire-driver-egrabber": "0.1.4",
55
"acquire-driver-hdcam": "0.1.6",
66
"acquire-driver-spinnaker": "0.1.1"

tests/test_basic.py

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,10 @@
1111
import tifffile
1212

1313

14-
@pytest.fixture(scope="module")
15-
def _runtime():
16-
runtime = acquire.Runtime()
17-
yield runtime
18-
19-
14+
# FIXME (aliddell): this should be module scoped, but the runtime is leaky
2015
@pytest.fixture(scope="function")
21-
def runtime(_runtime: Runtime):
22-
yield _runtime
23-
_runtime.set_configuration(acquire.Properties())
16+
def runtime():
17+
yield acquire.Runtime()
2418

2519

2620
def test_set():
@@ -527,7 +521,6 @@ def test_simulated_camera_capabilities(
527521
)
528522
def test_storage_capabilities(
529523
runtime: Runtime,
530-
request: pytest.FixtureRequest,
531524
descriptor: str,
532525
extension: str,
533526
chunking: Optional[Dict[str, Any]],
@@ -539,20 +532,13 @@ def test_storage_capabilities(
539532
p.video[0].camera.identifier = dm.select(DeviceKind.Camera, ".*empty")
540533
p.video[0].storage.identifier = dm.select(DeviceKind.Storage, descriptor)
541534

542-
# FIXME (aliddell): hack to get the storage capabilities to be populated
543-
p.video[0].storage.settings.filename = f"{request.node.name}.{extension}"
544-
545535
p.video[0].storage.settings.external_metadata_json = json.dumps(
546536
{"hello": "world"}
547537
) # for tiff-json
548538
p.video[0].max_frame_count = 1000
549539
runtime.set_configuration(p)
550540

551-
# FIXME (aliddell): hack to get the storage capabilities to be populated
552-
runtime.start()
553541
c = runtime.get_capabilities()
554-
# FIXME (aliddell): hack to get the storage capabilities to be populated
555-
runtime.abort()
556542
storage = c.video[0].storage
557543

558544
chunk_dims_px = storage.chunk_dims_px

tests/test_zarr.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,10 @@
1616
from acquire import Runtime, DeviceKind
1717

1818

19-
@pytest.fixture(scope="module")
20-
def _runtime():
21-
runtime = acquire.Runtime()
22-
yield runtime
23-
24-
19+
# FIXME (aliddell): this should be module scoped, but the runtime is leaky
2520
@pytest.fixture(scope="function")
26-
def runtime(_runtime: acquire.Runtime):
27-
yield _runtime
28-
_runtime.set_configuration(acquire.Properties())
21+
def runtime():
22+
yield acquire.Runtime()
2923

3024

3125
def test_write_external_metadata_to_zarr(

0 commit comments

Comments
 (0)