BCDA-APS / use_bluesky

Tools to help APS use the Bluesky Framework (https://blueskyproject.io/)
8 stars 3 forks source link

Make auto_monitor=True the default for EpicsSignals #77

Closed prjemian closed 3 years ago

prjemian commented 3 years ago

Per https://github.com/prjemian/ipython-aps/issues/3#issuecomment-719347017, the random PV read timeout affects measurements at APS beam lines. It is reproducible in a non-deterministic time interval since the occurrence is random.

In ophyd.EpicsSignal and ophyd.EpicsSignalRO, the default is auto_monitor=False. Need to change that default to auto_monitor=True for all.

prjemian commented 3 years ago

Related to https://github.com/bluesky/ophyd/pull/922#issuecomment-719356998

prjemian commented 3 years ago

Alternatively, the existing set_default_timeout() and proposed set_default_auto_monitor() methods could be combined into a single set_defaults() method and thus remove duplicated code and comments.

prjemian commented 3 years ago

This change should be left to the installation to implement and not defined in a package such as apstools. The issue can be applied to the suggested default configuration for new installations.

prjemian commented 3 years ago

Implementation is dependent on availability of new (since ophyd 1.5.4) ophyd.signal.set_defaults() method. Test for that and warn if not available. The test can be removed once new release of ophyd includes this change (pulled to master this week) and the new ophyd release number is a minimum installation requirement.

prjemian commented 3 years ago

This is waiting on the next release of ophyd (either 1.5.5 or 1.6.0) that includes PR https://github.com/bluesky/ophyd/pull/931.

prjemian commented 3 years ago

This is the new code:

# set default timeout for all EpicsSignalBase connections & communications
from ophyd.signal import EpicsSignalBase
EpicsSignalBase.set_defaults(
    auto_monitor=True,
    connection_timeout=5,
    timeout=10,
    write_timeout=60,
)