Coverage for core / src / sensorkit / sensor / __init__.py: 100%
14 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
2# ruff: noqa: F401
3"""Plan and execute workflows for a sensor's devices and instruments.
5`SensorDefinition` describes the device structure, lifecycle tables and deadline
6rules. Validation checks the document without contacting devices; binding then
7checks reported capabilities and establishes each device's traits.
9The lifecycle and collect compilers produce planned steps with dependencies.
10Shared graph compilation resolves capability omissions, deadlines and operator rules,
11then builds graphs for `sensorkit.common.dag` to schedule and execute.
13`Sensor` connects to devices and exposes planning and execution as
14separate calls. `audit` explains definitions and compiled workflows. The optional
15`policies` and `standard_task` adapters generate lifecycle tables and collect
16intents for the same compilers.
18`SensorController` serves a structure and policies from the `sensors`
19configuration section as a controller. `autofocus` plans its focus sweeps
20and reads back their analysis.
21"""
23from sensorkit.sensor.audit import (
24 AuditReport,
25 Finding,
26 audit_definition,
27 audit_workflow,
28)
29from sensorkit.sensor.binding import (
30 BoundSensor,
31)
32from sensorkit.sensor.client import Sensor
33from sensorkit.sensor.collect import (
34 AcquisitionRequest,
35 BoundCollect,
36 BoundEpoch,
37 Collect,
38 CollectIntent,
39 CommandRequest,
40 Epoch,
41 InstrumentRequest,
42 PackingConflict,
43 PlannedAcquisition,
44 RequestEpoch,
45 SettingUnsatisfiable,
46 compile_collect,
47 pack,
48)
49from sensorkit.sensor.definition import SensorDefinition
50from sensorkit.sensor.dispatch import (
51 AttemptRecorder,
52 DeviceContexts,
53 Dispatcher,
54 InstrumentContexts,
55 Interruption,
56 InterruptionOutcome,
57 InterruptionRecorder,
58 OperationEvent,
59 OperationOutcome,
60)
61from sensorkit.sensor.execution import (
62 AbortPredicate,
63 CleanupReport,
64 ExecutionState,
65 WorkflowError,
66 WorkflowExecutor,
67 WorkflowOutcome,
68 WorkflowReport,
69)
70from sensorkit.sensor.impl import SensorConfig, SensorController, sensor_service
71from sensorkit.sensor.lifecycle import (
72 CleanupSpec,
73 Entry,
74 Join,
75 LifecycleWorkflow,
76 OpSpec,
77 Phase,
78 compile_lifecycle,
79)
80from sensorkit.sensor.policies import (
81 SensorPolicies,
82 compose_deadlines,
83 compose_tables,
84)
85from sensorkit.sensor.routing import (
86 CommandRouter,
87 RoutedCommand,
88 Scope,
89 Subject,
90)
91from sensorkit.sensor.selection import (
92 AnySelection,
93 Selection,
94 SelectionError,
95)
96from sensorkit.sensor.topology import (
97 Component,
98 Device,
99 Placement,
100 Port,
101 Selector,
102 Structure,
103 StructurePath,
104 Topology,
105 Unit,
106)
107from sensorkit.sensor.workflow import (
108 Acquisition,
109 Cleanup,
110 CleanupPlan,
111 DeadlineRule,
112 DeadlineTarget,
113 Dependency,
114 ExecutableWorkflow,
115 Omission,
116 Operation,
117 OperatorRule,
118 Origin,
119 PlannedStep,
120 lower,
121 resolve_deadline,
122)