atef.config.PreparedGroup
- class atef.config.PreparedGroup(cache: 'DataCache', parent: 'Optional[Union[PreparedGroup, PreparedFile]]' = None, comparisons: 'List[Union[PreparedSignalComparison, PreparedToolComparison]]' = <factory>, prepare_failures: 'List[FailedConfiguration]' = <factory>, combined_result: 'Result' = <factory>, config: 'ConfigurationGroup' = <factory>, configs: 'List[AnyPreparedConfiguration]' = <factory>)[source]
- Attributes:
Methods
compare
()Run all comparisons and return a combined result.
from_config
(group[, parent, client, cache])Prepare a ConfigurationGroup for running.
get_value_by_name
(name)Get a value defined in this group or in any ancestor.
Walk through the prepared comparisons.
Walk through the prepared groups.
Methods
- __init__(cache: ~atef.cache.DataCache, parent: ~atef.config.PreparedGroup | ~atef.config.PreparedFile | None = None, comparisons: ~typing.List[~atef.config.PreparedSignalComparison | ~atef.config.PreparedToolComparison] = <factory>, prepare_failures: ~typing.List[~atef.config.FailedConfiguration] = <factory>, combined_result: ~atef.result.Result = <factory>, config: ~atef.config.ConfigurationGroup = <factory>, configs: ~typing.List[~atef.config.PreparedDeviceConfiguration | ~atef.config.PreparedGroup | ~atef.config.PreparedPVConfiguration | ~atef.config.PreparedToolConfiguration] = <factory>) None
- classmethod from_config(group: ConfigurationGroup, parent: PreparedGroup | PreparedFile | None = None, *, client: Client | None = None, cache: DataCache | None = None) PreparedGroup [source]
Prepare a ConfigurationGroup for running.
If available, provide an instantiated happi Client and a data cache. If unspecified, a configuration-derived happi Client will be instantiated and a new data cache will be utilized.
The provided cache (or a new one) will be utilized for every configuration/comparison in the file.
- Parameters:
- groupConfigurationGroup
The configuration group instance.
- parentPreparedGroup or PreparedFile, optional
The parent instance of the group. If this is the root configuration, the parent may be a PreparedFile.
- clienthappi.Client, optional
A happi Client instance.
- cacheDataCache, optional
The data cache instance, if available. If unspecified, a new data cache will be instantiated.
- get_value_by_name(name: str) Any [source]
Get a value defined in this group or in any ancestor. The first found is returned.
- Parameters:
- namestr
The key name for the
variables
dictionary.
- Returns:
- Any
Value defined for the given key.
- Raises:
- KeyError
If the key is not defined on this group or any ancestor group.
- walk_comparisons() Generator[PreparedComparison, None, None] [source]
Walk through the prepared comparisons.
- walk_groups() Generator[PreparedDeviceConfiguration | PreparedGroup | PreparedPVConfiguration | PreparedToolConfiguration, None, None] [source]
Walk through the prepared groups.
Attributes
- parent: PreparedGroup | PreparedFile | None = None
The hierarhical parent of this group. If this is the root group, ‘parent’ may be a PreparedFile.
- result
Re-compute the combined result and return it
- subgroups
Direct descendent subgroups in this group.
- Returns:
- List[PreparedGroup]
- config: ConfigurationGroup
The corresponding group from the configuration file.
- configs: List[PreparedDeviceConfiguration | PreparedGroup | PreparedPVConfiguration | PreparedToolConfiguration]
The configs defined in the group.
- prepare_failures: List[FailedConfiguration]
The configs that failed to prepare.
- cache: DataCache
The data cache to use for the preparation step.
- comparisons: List[PreparedSignalComparison | PreparedToolComparison]
The comparisons to be run on the given devices.
- combined_result: Result
The result of all comparisons.