Coverage for core / src / sensorkit / std / optics.py: 100%
25 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-09-02 00:03 +0000
« prev ^ index » next coverage.py v7.13.5, created at 2026-09-02 00:03 +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)
33"""A device that can change optical filters by name or position."""
36@sk.declare_keyword
37class FocusPosition(BaseModel):
38 """Current position of the focuser."""
40 position: float
43class ChangeFocusPosition(sk.DeviceCommand):
44 """Command to change the focus position to a specified value."""
46 position: float
49StandardFocuser = sk.declare_archetype(
50 "focuser",
51 required_commands=(ChangeFocusPosition,),
52)
53"""A device that can adjust a focus position."""
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."""