atef.check.BasicDynamic
- class atef.check.BasicDynamic(name: 'Optional[str]' = None, description: 'Optional[str]' = None, invert: 'bool' = False, reduce_period: 'Optional[Number]' = None, reduce_method: 'reduce.ReduceMethod' = <ReduceMethod.average: 'average'>, string: 'Optional[bool]' = None, severity_on_failure: 'Severity' = <Severity.error: 2>, if_disconnected: 'Severity' = <Severity.error: 2>, value_dynamic: 'Optional[DynamicValue]' = None)[source]
- Attributes:
- description
- name
- reduce_period
- string
- value_dynamic
Methods
__call__
(value)Run the comparison against
value
.compare
(value[, identifier])Compare the provided value using the comparator's settings.
describe
()Human-readable description of the comparison operation itself.
get_data_for_signal
(signal)Get data for the given signal, according to the string and data reduction settings.
get_data_for_signal_async
(signal, *[, executor])Get data for the given signal, according to the string and data reduction settings.
prepare
([cache])Prepare this comparison's value data.
Methods
- __init__(name: str | None = None, description: str | None = None, invert: bool = False, reduce_period: int | float | None = None, reduce_method: ReduceMethod = ReduceMethod.average, string: bool | None = None, severity_on_failure: Severity = Severity.error, if_disconnected: Severity = Severity.error, value_dynamic: DynamicValue | None = None) None
- compare(value: Any, identifier: str | None = None) Result
Compare the provided value using the comparator’s settings.
- Parameters:
- value
The value to compare.
- identifierstr, optional
An identifier that goes along with the provided value. Used for severity result descriptions.
- describe() str
Human-readable description of the comparison operation itself.
To be implemented by subclass.
- get_data_for_signal(signal: Signal) Any
Get data for the given signal, according to the string and data reduction settings.
- Parameters:
- signalophyd.Signal
The signal.
- Returns:
- Any
The acquired data.
- Raises:
- TimeoutError
If the get operation times out.
- async get_data_for_signal_async(signal: Signal, *, executor: Executor | None = None) Any
Get data for the given signal, according to the string and data reduction settings.
- Parameters:
- signalophyd.Signal
The signal.
- executorconcurrent.futures.Executor, optional
The executor to run the synchronous call in. Defaults to the loop-defined default executor.
- Returns:
- Any
The acquired data.
- Raises:
- TimeoutError
If the get operation times out.
- async prepare(cache: DataCache | None = None) None [source]
Prepare this comparison’s value data. If a value_dynamic is specified, prepare its data
- Parameters:
- cacheDataCache, optional
The data cache instance, if available.
Attributes
- if_disconnected: Severity = 2
If disconnected and unable to perform the comparison, set this result severity.
- invert: bool = False
Invert the comparison’s result. Normally, a valid comparison - that is, one that evaluates to True - is considered successful. When
invert
is set, such a comparison would be considered a failure.
- reduce_method: ReduceMethod = 'average'
Reduce collected samples by this reduce method.
- reduce_period: int | float | None = None
Period over which the comparison will occur, where multiple samples may be acquired prior to a result being available.
- severity_on_failure: Severity = 2
If the comparison fails, use this result severity.
- string: bool | None = None
If applicable, request and compare string values rather than the default specified.
- value_dynamic: DynamicValue | None = None