slaclab / pysmurf

Other
2 stars 9 forks source link

Newer pyepics versions change default caget behavior #725

Closed swh76 closed 1 year ago

swh76 commented 1 year ago

While working with @jlashner to upgrade the versions of software in our dockers (since some of our software is becoming EOL'd) we encountered an issue trying to run with upgraded dockers ; after what looked like a successful setup, we were unable to get sensible results from the cryostat card. Digging in I found that the version of pyepics (https://github.com/pyepics/pyepics/) used in our existing dockers, version 3.4.1, has a different default behavior than in the most recent EPICS version, which is version 3.5.1.

A different default for the use_monitor argument seems to be the culprit; whereas the default behavior in 3.4.1 is;

In [2]: import epics                                                                                                      

In [3]: epics.__version__                                                                                                 
Out[3]: '3.4.1'

In [4]: epics.caget?                                                                                                      
Signature:
epics.caget(
    pvname,
    as_string=False,
    count=None,
    as_numpy=True,
    use_monitor=False,
    timeout=5.0,
)

the default behavior in 3.5.1 is ;

Signature:
epics.caget(
    pvname,
    as_string=False,
    count=None,
    as_numpy=True,
    use_monitor=True,
    timeout=5.0,
    connection_timeout=5.0,
)

The use_monitor default value was changed! I verified enforcing use_monitor=False in Jack's new dockers using pyepics 3.5.1 recovers the ability to communicate with the cryostat card. I plan to add this as an explicit option to all caget calls in pysmurf so we're compatible with versions 3.5.1+ of pyepics.