Skip to content

Commit

Permalink
Merge pull request #323 from klauer/enh_load_time
Browse files Browse the repository at this point in the history
ENH: include per-device load time if available
  • Loading branch information
ZLLentz authored Mar 9, 2022
2 parents 7f55e3d + 35c405d commit 5015ab0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion hutch_python/happi.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import inspect
import logging

import happi
Expand Down Expand Up @@ -62,7 +63,12 @@ def get_happi_objs(db, hutch):
logger.warning("No items found in database for %s",
beamline.upper())
# Instantiate the devices needed
dev_namespace = load_devices(*containers, pprint=False)
sig = inspect.signature(load_devices)
if "include_load_time" in sig.parameters:
kwargs = dict(include_load_time=True, load_time_threshold=0.5)
else:
kwargs = {}
dev_namespace = load_devices(*containers, pprint=False, **kwargs)
return dev_namespace.__dict__


Expand Down

0 comments on commit 5015ab0

Please sign in to comment.