Skip to content

Commit

Permalink
Add except for caget failure (#576)
Browse files Browse the repository at this point in the history
* Adds except for caget failure

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add pyepics as dependency for pysmurf-controller agent

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Brian Koopman <[email protected]>
  • Loading branch information
3 people authored Nov 27, 2023
1 parent fc79849 commit 83c75f7
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
6 changes: 6 additions & 0 deletions docs/agents/pysmurf-controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ These can be installed via pip:
$ python -m pip install 'sodetlib @ git+https://github.com/simonsobs/sodetlib.git@master'
$ python -m pip install 'sotodlib @ git+https://github.com/simonsobs/sotodlib.git@master'
Additionally, ``socs`` should be installed with the ``pysmurf`` group:

.. code-block:: bash
$ pip install -U socs[pysmurf]
Configuration File Examples
-----------------------------------

Expand Down
2 changes: 2 additions & 0 deletions docs/user/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ The different groups, and the agents they provide dependencies for are:
- Magpie Agent
* - ``pfeiffer``
- Pfeiffer TC 400 Agent
* - ``pysmurf``
- Pysmurf Controller Agent
* - ``smurf_sim``
- SMuRF File Emulator, SMuRF Stream Simulator
* - ``synacc``
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ pandas
pfeiffer-vacuum-protocol==0.4

# pysmurf controller
pyepics
pysmurf @ git+https://github.com/slaclab/pysmurf.git@main
sodetlib @ git+https://github.com/simonsobs/sodetlib.git@master
sotodlib @ git+https://github.com/simonsobs/sotodlib.git@master
Expand Down
15 changes: 8 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@
pfeiffer_deps = ['pfeiffer-vacuum-protocol==0.4']

# Pysmurf Controller Agent
# pysmurf_deps = [
# 'pysmurf @ git+https://github.com/slaclab/pysmurf.git@main',
# 'sodetlib @ git+https://github.com/simonsobs/sodetlib.git@master',
# 'sotodlib @ git+https://github.com/simonsobs/sotodlib.git@master',
# ]
pysmurf_deps = [
'pyepics',
# 'pysmurf @ git+https://github.com/slaclab/pysmurf.git@main',
# 'sodetlib @ git+https://github.com/simonsobs/sodetlib.git@master',
# 'sotodlib @ git+https://github.com/simonsobs/sotodlib.git@master',
]

# SMuRF File Emulator, SMuRF Stream Simulator
smurf_sim_deps = ['so3g']
Expand All @@ -60,7 +61,7 @@
# Note: Not including the holograph deps, which are Python 3.8 only. Also not
# including any dependencies with only direct references.
all_deps = acu_deps + labjack_deps + magpie_deps + pfeiffer_deps + \
smurf_sim_deps + synacc_deps + timing_master_deps
pysmurf_deps + smurf_sim_deps + synacc_deps + timing_master_deps
all_deps = list(set(all_deps))

setup(
Expand Down Expand Up @@ -119,7 +120,7 @@
'labjack': labjack_deps,
'magpie': magpie_deps,
'pfeiffer': pfeiffer_deps,
# 'pysmurf': pysmurf_deps,
'pysmurf': pysmurf_deps,
'smurf_sim': smurf_sim_deps,
'synacc': synacc_deps,
'timing_master': timing_master_deps,
Expand Down
3 changes: 2 additions & 1 deletion socs/agents/pysmurf_controller/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import time
from typing import Optional

import epics
import numpy as np
import sodetlib as sdl
from ocs import ocs_agent, site_config
Expand Down Expand Up @@ -316,7 +317,7 @@ def check_state(self, session, params=None):
stream_id=cfg.stream_id,
)
session.data.update(d)
except RuntimeError:
except (RuntimeError, epics.ca.ChannelAccessGetFailure):
self.log.warn("Could not connect to epics server! Waiting and "
"then trying again")

Expand Down

0 comments on commit 83c75f7

Please sign in to comment.