BaseFilteredFieldWrapper¶
- class lsst.ts.watcher.BaseFilteredFieldWrapper(model, topic, filter_field, filter_value)¶
Bases:
abc.ABC
Base class for filtered field wrappers.
Extract and cache the most recent value of a topic field for data that matches a specified filter.
Unlike
FilteredTopicWrapper
(which stores data for all different values of a filter field),BaseFilteredFieldWrapper`
is specific to a particular value of the filter field. The point is to extract a particular value from a particular subsystem.- Parameters
- Raises
- ValueError
If field wrapper validation fails.
- Attributes
Methods Summary
update_value
(data)Set
value
from data.validate
(data)Check the configuration given default topic data.
Methods Documentation
- abstract update_value(data)¶
Set
value
from data.The subclass should assume that getattr(data, filter_field) == self.filter_value; it is up to the caller to make sure that is so.
- abstract validate(data)¶
Check the configuration given default topic data.
- Raises
- ValueError
If validation fails.
- Note: the contained topic wrapper checks for the existence of
- the filter field, so this method does not have to bother.