hutch_python.load_conf.load_conf

hutch_python.load_conf.load_conf(conf, hutch_dir=None)

Step through the object loading procedure, given a configuration.

The procedure is:

  • Check the configuration for errors

  • Display the banner by calling hutch_banner

  • Use hutch key to create hutch.db importable namespace to stash the objects. This will be literally hutch.db if hutch is not provided, or the hutch name e.g. mfx.db.

  • Create a RunEngine, RE

  • Import plan_defaults and include as p, plans

  • Create a daq object with RE registered.

  • Create a scan_pvs object, and leave it disabled.

  • Use hutch and daq_platform keys to create the elog object and configure it to match the correct experiment.

  • Use db key to load devices from the happi beamline database and create a hutch_beampath object from lightpath

  • Use hutch key to load detector objects from the camviewer configuration file.

  • Use load key to bring up the user’s beamline modules

  • Use experiment key to select the current experiment

    • If experiment was missing, autoselect experiment using hutch key

  • Use current experiment to load experiment objects from questionnaire

  • Use current experiment to load experiment file

If a conf key is missing, we’ll note it in a logger.info message. If an extra conf entry is found, we’ll note it in a logger.warning message. If an automatically selected file is missing, we’ll note it in a logger.info message. All other errors will be noted in a logger.error message.

Parameters
  • conf (dict) – dict interpretation of the original yaml file

  • hutch_dir (Path or str, optional) – Path object that points to the hutch’s launch directory. This is the directory that includes the experiments directory and a hutchname directory e.g. mfx If this is missing, we’ll be unable to write the db.txt file, do relative filepath database selection for happi, or establish a preset positions directory.

Returns

objs – See the return value of load

Return type

dict{str: object}