Skip to content

Commit 07899b8

Browse files
committed
Renamed cothread_cs and removed cothread elsewhere
1 parent 3797bba commit 07899b8

File tree

4 files changed

+13
-15
lines changed

4 files changed

+13
-15
lines changed

docs/user/explanations/what-is-pytac.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ with EPICS, readback (``pytac.RB``) or setpoint (``pytac.SP``).
5151
Data may be set to or retrieved from different data sources, from the live
5252
machine (``pytac.LIVE``) or from a simulator (``pytac.SIM``). By default the
5353
'live' data source is implemented using
54-
`Cothread <https://github.com/dls-controls/cothread>`_ to communicate with
54+
`aioca <https://github.com/dls-controls/aioca>`_ to communicate with
5555
EPICS, as described above. The 'simulation' data source is left unimplemented,
5656
as Pytac does not include a simulator. However, ATIP, a module designed to
5757
integrate the `Accelerator Toolbox <https://github.com/atcollab/at>`_ simulator

docs/user/tutorials/basic-tutorial.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ In this tutorial we will go through some of the most common ways of using pytac.
55
The aim is to give you an understanding of the interface and how to find out what
66
is available.
77

8-
The import of the cothread channel access library and epicscorelibs will
8+
The import of the aioca channel access library and epicscorelibs will
99
allow us to get some live values from the Diamond accelerators.
1010

11-
$ pip install cothread epicscorelibs
11+
$ pip install aioca epicscorelibs
1212

1313
These docs are able to be run and tested, but may return different values as
1414
accelerator conditions will have changed.

src/pytac/cothread_cs.py renamed to src/pytac/aioca_cs.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import logging
22

3-
# from cothread.catools import ca_nothing, caget, caput
4-
from cothread.catools import ca_nothing
53
from aioca import caget, caput, CANothing
64
from pytac.cs import ControlSystem
75
from pytac.exceptions import ControlSystemException
86

97

108
class AIOCAControlSystem(ControlSystem):
11-
"""A control system using cothread to communicate with EPICS.
9+
"""A control system using aioca to communicate with EPICS.
1210
1311
N.B. this is the default control system. It is used to communicate over
1412
channel access with the hardware in the ring.
@@ -37,7 +35,7 @@ async def get_single(self, pv, throw=True):
3735
"""
3836
try:
3937
return await caget(pv, timeout=self._timeout, throw=True)
40-
except ca_nothing:
38+
except CANothing:
4139
error_msg = f"Cannot connect to {pv}."
4240
if throw:
4341
raise ControlSystemException(error_msg)
@@ -64,7 +62,7 @@ async def get_multiple(self, pvs, throw=True):
6462
return_values = []
6563
failures = []
6664
for result in results:
67-
if isinstance(result, ca_nothing):
65+
if isinstance(result, CANothing):
6866
logging.warning(f"Cannot connect to {result.name}.")
6967
if throw:
7068
failures.append(result)
@@ -94,7 +92,7 @@ async def set_single(self, pv, value, throw=True):
9492
try:
9593
await caput(pv, value, timeout=self._timeout, throw=True, wait=self._wait)
9694
return True
97-
except ca_nothing:
95+
except CANothing:
9896
error_msg = f"Cannot connect to {pv}."
9997
if throw:
10098
raise ControlSystemException(error_msg)

src/pytac/load_csv.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,20 +191,20 @@ async def load(
191191
Lattice: The lattice containing all elements.
192192
193193
Raises:
194-
ControlSystemException: if the default control system, cothread, is not
194+
ControlSystemException: if the default control system, aioca, is not
195195
installed.
196196
"""
197197
try:
198198
if control_system is None:
199199
# Don't import epics unless we need it to avoid unnecessary
200-
# installation of cothread
201-
from pytac import cothread_cs
200+
# installation of aioca
201+
from pytac import aioca_cs
202202

203-
control_system = cothread_cs.AIOCAControlSystem()
203+
control_system = aioca_cs.AIOCAControlSystem()
204204
except ImportError:
205205
raise ControlSystemException(
206-
"Please install cothread to load a lattice using the default control system"
207-
" (found in cothread_cs.py)."
206+
"Please install aioca to load a lattice using the default control system"
207+
" (found in aioca_cs.py)."
208208
)
209209
if directory is None:
210210
directory = Path(__file__).resolve().parent / "data"

0 commit comments

Comments
 (0)