Coverage for core / src / sensorkit / std / optics.py: 100%
22 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-11-24 01:04 +0000
« prev ^ index » next coverage.py v7.13.5, created at 2026-11-24 01:04 +0000
1# SPDX-License-Identifier: Apache-2.0
2from pydantic import BaseModel, Field
4import sensorkit.api as sk
7@sk.declare_keyword
8class Filter(BaseModel):
9 """Represents an optical filter with its properties."""
11 name: str
12 position: int | None = None
13 wavelength: float | None = None
16@sk.declare_keyword
17class Filters(BaseModel):
18 """Collection of optical filters available in a filter changer."""
20 filters: list[Filter] = Field(default_factory=list)
23class SetFilter(sk.DeviceCommand):
24 """Set the active optical filter by name or position."""
26 filter: str | int
29StandardFilterChanger = sk.declare_archetype(
30 "filter_changer",
31 required_commands=(SetFilter,),
32 required_keywords=("Filters",),
33)
34"""A device that reports available filters and selects one by name or
35position.
36"""
39class SelectPort(sk.DeviceCommand):
40 """Route the beam to one of a selector's ports.
42 The port is named as the structure names it, since a port's name is the value
43 commanded to reach it.
44 """
46 port: str
49StandardSelector = sk.declare_archetype(
50 "selector",
51 required_commands=(SelectPort,),
52)
53"""A pick-off mirror, fold mirror or fiber selector that routes a beam."""
56class OpenMirrorCover(sk.DeviceCommand):
57 """Command to open the mirror cover."""
60class CloseMirrorCover(sk.DeviceCommand):
61 """Command to close the mirror cover."""
64StandardMirrorCover = sk.declare_archetype(
65 "mirror_cover",
66 required_commands=(OpenMirrorCover,CloseMirrorCover,),
67)
68"""A device representing a mirror cover that can be opened and closed."""