diff --git a/CHANGES.rst b/CHANGES.rst index 5d4984b1..0ca9542a 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -44,6 +44,7 @@ New Features * ophyd-registry * Build ``oregistry`` of all ophyd objects. +* Post a warning if at APS but not on controls subnet. Maintenance ------------ diff --git a/bluesky/instrument/framework/initialize.py b/bluesky/instrument/framework/initialize.py index b44676da..34c3a8f3 100644 --- a/bluesky/instrument/framework/initialize.py +++ b/bluesky/instrument/framework/initialize.py @@ -22,6 +22,7 @@ sys.path.append(str(pathlib.Path(__file__).absolute().parent.parent.parent)) from .. import iconfig +from apstools.utils import warn_if_not_aps_controls_subnet from bluesky import RunEngine from bluesky import SupplementalData from bluesky.callbacks.best_effort import BestEffortCallback @@ -42,6 +43,9 @@ import bluesky.preprocessors as bpp # noqa import numpy as np # noqa +# Post a warning if at APS but not on controls subnet. +warn_if_not_aps_controls_subnet() + def get_md_path(): path = iconfig.get("RUNENGINE_MD_PATH") @@ -52,12 +56,10 @@ def get_md_path(): logger.info("RunEngine metadata saved in directory: %s", str(path)) return str(path) - # Set up a RunEngine and use metadata backed PersistentDict RE = RunEngine({}) RE.md = PersistentDict(get_md_path()) - # Connect with our mongodb database catalog_name = iconfig.get("DATABROKER_CATALOG", "training") # databroker v2 api @@ -68,7 +70,6 @@ def get_md_path(): cat = databroker.temp().v2 logger.info("using TEMPORARY databroker catalog '%s'", cat.name) - # Subscribe metadatastore to documents. # If this is removed, data is not saved to metadatastore. RE.subscribe(cat.v1.insert)