bluesky_adaptive.per_start.recommender_factory#
- bluesky_adaptive.per_start.recommender_factory(adaptive_obj, independent_keys, dependent_keys, *, max_count=10, queue=None)[source]#
Generate the callback and queue for an Adaptive API backed reccomender.
This recommends a fixed step size independent of the measurement.
For each Run (aka Start) that the callback sees it will place either a recommendation or
None
into the queue. Recommendations will be of a dict mapping the independent_keys to the recommended values and should be interpreted by the plan as a request for more data. ANone
placed in the queue should be interpreted by the plan as in instruction to terminate the run.The StartDocuments in the stream must contain the key
'batch_count'
.- Parameters:
- adaptive_objectadaptive.BaseLearner
The recommendation engine
- independent_keysList[str]
The names of the independent keys in the events
- dependent_keysList[str]
The names of the dependent keys in the events
- max_countint, optional
The maximum number of measurements to take before poisoning the queue.
- queueQueue, optional
The communication channel for the callback to feedback to the plan. If not given, a new queue will be created.
- Returns:
- callbackCallable[str, dict]
This function must be subscribed to RunEngine to receive the document stream.
- queueQueue
The communication channel between the callback and the plan. This is always returned (even if the user passed it in).