Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capabilities interface #113

Merged
merged 29 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
394f482
Update chunking API.
aliddell Nov 17, 2023
0f40e26
Fix up README so Python code works as written and Spinnaker driver is…
aliddell Nov 17, 2023
7ccb9c3
Add Zarr V3 tests. Add a note about environment variables in Zarr V3 …
aliddell Nov 17, 2023
459aea8
Bump minor release version.
aliddell Nov 17, 2023
8dbfa74
Update Zarr driver to v0.1.5.
aliddell Nov 20, 2023
8fddb9f
Recall that target: pull_request is what you want when testing workfl…
aliddell Nov 20, 2023
e43b8eb
Update Zarr syntax in eGrabber tests.
aliddell Nov 20, 2023
62ba589
Remove a bunch of commented code.
aliddell Nov 20, 2023
11247d7
Expose AcquirePropertyMetadata as Capabilities (mypy and stubtest pas…
aliddell Nov 21, 2023
317d52b
Tests for simulated camera capabilities.
aliddell Nov 21, 2023
874bf9b
Merge remote-tracking branch 'upstream/main' into zarrv3-plus-capabil…
aliddell Nov 21, 2023
fefd5fc
Implement, but skip, testing storage metadata.
aliddell Nov 21, 2023
6452f8b
Fix an image shape for simulated camera configuration to ensure consi…
aliddell Nov 21, 2023
dd26856
Restore test_pr to pull_request_target.
aliddell Nov 21, 2023
79f117c
Unskip test_storage_capabilities.
aliddell Nov 21, 2023
67b0205
Restore test_pr to pull_request_target (again).
aliddell Nov 21, 2023
8cd2e2a
Test formatting.
aliddell Nov 22, 2023
e096742
Merge remote-tracking branch 'upstream/main' into zarrv3-plus-capabil…
aliddell Nov 22, 2023
637e80f
Merge remote-tracking branch 'upstream/main' into zarrv3
aliddell Nov 22, 2023
8d919d8
Update tests/test_basic.py
aliddell Nov 22, 2023
72ae5e9
Update test_pr.yml
aliddell Nov 22, 2023
b3c90dd
Update Cargo.toml
aliddell Nov 22, 2023
9b88453
Revert "Update Cargo.toml"
aliddell Nov 22, 2023
22e1119
Merge branch 'zarrv3' into zarrv3-plus-capabilities
aliddell Nov 22, 2023
b0265bb
Merge remote-tracking branch 'upstream/main' into zarrv3-plus-capabil…
aliddell Nov 22, 2023
63ebfae
Address PR comments.
aliddell Nov 27, 2023
0920d5d
Ignore files created by `test_storage_capabilities`.
aliddell Nov 27, 2023
1c102ee
Make Capabilities properties read-only.
aliddell Nov 27, 2023
8fe4c0a
Split ChunkingShardingCapabilities into ChunkingCapabilities and Shar…
aliddell Nov 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ imgui.ini
Testing
*.zarr
*.tif
*.bin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where's the bin coming from?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Writing out a raw file in one of the tests.

*.json
Cargo.lock

Expand Down
104 changes: 100 additions & 4 deletions python/acquire/acquire.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ class Camera:
def __init__(self, *args: None, **kwargs: Any) -> None: ...
def dict(self) -> Dict[str, Any]: ...

@final
class CameraCapabilities:
exposure_time_us: Property
line_interval_us: Property
readout_direction: Property
binning: Property
offset: OffsetShapeCapabilities
shape: OffsetShapeCapabilities
supported_pixel_types: List[SampleType]
digital_lines: DigitalLineCapabilities
triggers: TriggerCapabilities
def dict(self) -> Dict[str, Any]: ...

@final
class CameraProperties:
exposure_time_us: float
Expand All @@ -39,6 +52,27 @@ class CameraProperties:
def __init__(self, *args: None, **kwargs: Any) -> None: ...
def dict(self) -> Dict[str, Any]: ...

@final
class Capabilities:
video: Tuple[VideoStreamCapabilities, VideoStreamCapabilities]
def __init__(self, *args: None, **kwargs: Any) -> None: ...
def dict(self) -> Dict[str, Any]: ...

@final
class ChunkingShardingDims:
width: int
height: int
planes: int
def dict(self) -> Dict[str, Any]: ...

@final
class ChunkingShardingCapabilities:
is_supported: bool
width: Property
height: Property
planes: Property
def dict(self) -> Dict[str, Any]: ...

@final
class DeviceIdentifier:
id: Tuple[int, int]
Expand Down Expand Up @@ -100,6 +134,12 @@ class DeviceState:
def __lt__(self, other: object) -> bool: ...
def __ne__(self, other: object) -> bool: ...

@final
class DigitalLineCapabilities:
line_count: int
names: Tuple[str, str, str, str, str, str, str, str]
def dict(self) -> Dict[str, Any]: ...

@final
class Direction:
Backward: ClassVar[Direction] = Direction.Backward
Expand All @@ -119,6 +159,17 @@ class InputTriggers:
frame_start: Trigger
def dict(self) -> Dict[str, Any]: ...

@final
class MultiscaleCapabilities:
is_supported: bool
def dict(self) -> Dict[str, Any]: ...

@final
class OffsetShapeCapabilities:
x: Property
y: Property
def dict(self) -> Dict[str, Any]: ...

@final
class OutputTriggers:
exposure: Trigger
Expand All @@ -134,6 +185,29 @@ class PID:
def __init__(self, *args: None, **kwargs: Any) -> None: ...
def dict(self) -> Dict[str, Any]: ...

@final
class Property:
writable: bool
low: float
high: float
kind: PropertyType
def __init__(self, *args: None, **kwargs: Any) -> None: ...
def dict(self) -> Dict[str, Any]: ...

@final
class PropertyType:
FixedPrecision: ClassVar[PropertyType] = PropertyType.FixedPrecision
FloatingPrecision: ClassVar[PropertyType] = PropertyType.FloatingPrecision
Enum: ClassVar[PropertyType] = PropertyType.Enum
String: ClassVar[PropertyType] = PropertyType.String
def __eq__(self, other: object) -> bool: ...
def __ge__(self, other: object) -> bool: ...
def __gt__(self, other: object) -> bool: ...
def __int__(self) -> int: ...
def __le__(self, other: object) -> bool: ...
def __lt__(self, other: object) -> bool: ...
def __ne__(self, other: object) -> bool: ...

@final
class Properties:
video: Tuple[VideoStream, VideoStream]
Expand All @@ -146,6 +220,7 @@ class Runtime:
def device_manager(self) -> DeviceManager: ...
def get_available_data(self, stream_id: int) -> AvailableData: ...
def get_configuration(self) -> Properties: ...
def get_capabilities(self) -> Capabilities: ...
def get_state(self) -> DeviceState: ...
def set_configuration(self, properties: Properties) -> Properties: ...
def start(self) -> None: ...
Expand Down Expand Up @@ -209,10 +284,10 @@ class Storage:
def dict(self) -> Dict[str, Any]: ...

@final
class ChunkingShardingDims:
width: int
height: int
planes: int
class StorageCapabilities:
chunk_dims_px: ChunkingShardingCapabilities
Copy link
Contributor

@andy-sweet andy-sweet Nov 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I don't love the name of the type here because it's long and includes two needs (that are the same right now, but might diverge in the future?). Is it worth using the same underlying private definition, but defining separately named classes for ChunkingCapabilities and ShardingCapabilities?

Similar comment for ChunkingShardingDims.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I like the idea of exposing ChunkingCapabilities and ShardingCapabilities even though they derive from the same private type.

shard_dims_chunks: ChunkingShardingCapabilities
multiscale: MultiscaleCapabilities
def dict(self) -> Dict[str, Any]: ...

@final
Expand All @@ -235,6 +310,13 @@ class Trigger:
def __init__(self, *args: None, **kwargs: Any) -> None: ...
def dict(self) -> Dict[str, Any]: ...

@final
class TriggerCapabilities:
acquisition_start: TriggerInputOutputCapabilities
exposure: TriggerInputOutputCapabilities
frame_start: TriggerInputOutputCapabilities
def dict(self) -> Dict[str, Any]: ...

@final
class TriggerEdge:
Falling: ClassVar[TriggerEdge] = TriggerEdge.Falling
Expand All @@ -251,6 +333,12 @@ class TriggerEdge:
def __lt__(self, other: object) -> bool: ...
def __ne__(self, other: object) -> bool: ...

@final
class TriggerInputOutputCapabilities:
input: int
output: int
def dict(self) -> Dict[str, Any]: ...

@final
class VideoFrame:
def data(self) -> NDArray[Any]: ...
Expand All @@ -276,6 +364,14 @@ class VideoStream:
frame_average_count: int
def dict(self) -> Dict[str, Any]: ...

@final
class VideoStreamCapabilities:
camera: CameraCapabilities
storage: StorageCapabilities
max_frame_count: Property
frame_average_count: Property
def dict(self) -> Dict[str, Any]: ...

@final
class VoltageRange:
mn: float
Expand Down
Loading
Loading