Device¶
Base classes¶
Base class for devices.
Users may subclass from this device and implement their own configuration properties and methods.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the device. Serves as a unique identifier for the object created from it. |
required |
kwargs
|
Any
|
Additional keyword arguments for device subclasses. |
{}
|
Source code in src/redsun/device/_base.py
describe_configuration
abstractmethod
¶
Provide a description of the device configuration.
Subclasses should override this method to provide their own configuration description compatible with the Bluesky event model.
Returns:
| Type | Description |
|---|---|
dict[str, Descriptor]
|
A dictionary with the description of each field of the device configuration. |
Source code in src/redsun/device/_base.py
read_configuration
abstractmethod
¶
Provide a description of the device configuration.
Subclasses should override this method to provide their own configuration reading compatible with the Bluesky event model.
Returns:
| Type | Description |
|---|---|
dict[str, Reading[Any]]
|
A dictionary with the reading of each field of the device configuration. |
Source code in src/redsun/device/_base.py
Bases: HasName, HasParent, Configurable[Any], Protocol
Minimal required protocol for a recognizable device in Redsun.
Protocols¶
Device-level protocols for redsun.
This module defines structural protocols that devices can implement to participate in specific redsun behaviours, beyond the standard Bluesky device protocols.
HasCache
¶
Bases: Protocol
Protocol for devices that can cache readings during a plan.
Devices implementing this protocol can accumulate readings in an internal cache (e.g. for metadata collection or deferred writing) and have that cache cleared between acquisitions.
Source code in src/redsun/device/protocols.py
stash
abstractmethod
¶
Stash values into the device cache.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
values
|
dict[str, Reading[Any]]
|
Readings to cache, keyed by the canonical |
required |
Returns:
| Type | Description |
|---|---|
Status
|
A status object that completes when the cache operation finishes. |