MockModel¶
- class lsst.ts.watcher.MockModel(enabled=False)¶
Bases:
object
Methods Summary
get_filtered_topic_wrapper
(topic, filter_field)Get an existing
TopicWrapper
.make_filtered_topic_wrapper
(topic, filter_field)Make a TopicWrapper, or return an existing one, if found.
Methods Documentation
- get_filtered_topic_wrapper(topic, filter_field)¶
Get an existing
TopicWrapper
.- Parameters:
- topic
lsst.ts.salobj.ReadTopic
Topic to read.
- filter_field
str
Field to filter on. The field must be a scalar. It should also have a smallish number of expected values, in order to avoid caching too much data.
- topic
- Raises:
- KeyError
If the wrapper is not in the registry.
- make_filtered_topic_wrapper(topic, filter_field)¶
Make a TopicWrapper, or return an existing one, if found.
Call this instead of constructing
TopicWrapper
directly.- Parameters:
- model
Model
Watcher model. Used to add a TopicCallback to the topic, if one does not already exist.
- topic
lsst.ts.salobj.ReadTopic
Topic to read.
- filter_field
str
Field to filter on. The field must be a scalar. It should also have a smallish number of expected values, in order to avoid caching too much data.
- model