apsbits.core.run_engine_init#
Setup the Bluesky RunEngine, provides RE
and sd
.#
|
Initialize and configure a bluesky RunEngine (RE) instance. |
Functions
|
Initialize and configure a bluesky RunEngine (RE) instance. |
- apsbits.core.run_engine_init.init_RE(iconfig, bec_instance=None, cat_instance=None)[source]#
Initialize and configure a bluesky RunEngine (RE) instance.
This function sets up the RunEngine with metadata storage, subscriptions, preprocessors, and other configurations based on the provided input parameters and configuration dictionary.
- Args:
- iconfig (dict): Configuration dictionary containing settings for the
RunEngine. Expected keys include: - “RUN_ENGINE”: A dictionary with RunEngine-specific settings. - “MD_STORAGE_HANDLER”: (Optional) The handler for metadata storage
(default is “StoredDict”).
“DEFAULT_METADATA”: (Optional) Default metadata to be added to the RunEngine.
“USE_PROGRESS_BAR”: (Optional) Boolean to enable/disable the progress bar (default is True).
- bec_instance (object, optional): An instance of BestEffortCallback (BEC)
for subscribing to the RunEngine. Defaults to bec.
- cat_instance (object, optional): An instance of a databroker catalog
for subscribing to the RunEngine. Defaults to cat.
- Returns:
- tuple: A tuple containing the configured RunEngine instance and the
SupplementalData instance.
- Raises:
Exception: If there is an error creating the metadata storage handler.
- Notes:
The function ensures that the RE.md dictionary is saved/restored using the specified metadata storage handler.
Subscriptions to the catalog and BEC are added if the respective instances are provided.
Additional configurations such as control layer setup, timeouts, and progress bar are applied.