Skip to content

Commit c99368c

Browse files
committed
Remove async where not needed and fix linting
1 parent 7f2d733 commit c99368c

File tree

6 files changed

+19
-12
lines changed

6 files changed

+19
-12
lines changed

src/pytac/aioca_cs.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import logging
22

3-
from aioca import caget, caput, CANothing
3+
from aioca import CANothing, caget, caput
4+
45
from pytac.cs import ControlSystem
56
from pytac.exceptions import ControlSystemException
67

@@ -121,7 +122,9 @@ async def set_multiple(self, pvs, values, throw=True):
121122
"""
122123
if len(pvs) != len(values):
123124
raise ValueError("Please enter the same number of values as PVs.")
124-
status = await caput(pvs, values, timeout=self._timeout, throw=False, wait=self._wait)
125+
status = await caput(
126+
pvs, values, timeout=self._timeout, throw=False, wait=self._wait
127+
)
125128
return_values = []
126129
failures = []
127130
for stat in status:

src/pytac/cs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class ControlSystem(object):
1010
**Methods:**
1111
"""
1212

13-
async def get_single(self, pv, throw):
13+
def get_single(self, pv, throw):
1414
"""Get the value of a given PV.
1515
1616
Args:
@@ -27,7 +27,7 @@ async def get_single(self, pv, throw):
2727
"""
2828
raise NotImplementedError()
2929

30-
async def get_multiple(self, pvs, throw):
30+
def get_multiple(self, pvs, throw):
3131
"""Get the value for given PVs.
3232
3333
Args:
@@ -44,7 +44,7 @@ async def get_multiple(self, pvs, throw):
4444
"""
4545
raise NotImplementedError()
4646

47-
async def set_single(self, pv, value, throw):
47+
def set_single(self, pv, value, throw):
4848
"""Set the value of a given PV.
4949
5050
Args:
@@ -58,7 +58,7 @@ async def set_single(self, pv, value, throw):
5858
"""
5959
raise NotImplementedError()
6060

61-
async def set_multiple(self, pvs, values, throw):
61+
def set_multiple(self, pvs, values, throw):
6262
"""Set the values for given PVs.
6363
6464
Args:

src/pytac/data_source.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def get_fields(self):
2828
"""
2929
raise NotImplementedError()
3030

31-
async def get_value(self, field, handle, throw):
31+
def get_value(self, field, handle, throw):
3232
"""Get a value for a field.
3333
3434
Args:

src/pytac/device.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def is_enabled(self) -> bool:
2929
"""
3030
raise NotImplementedError()
3131

32-
async def get_value(self, handle: str, throw: bool) -> float:
32+
def get_value(self, handle: str, throw: bool) -> float:
3333
"""Read the value from the device.
3434
3535
Args:

src/pytac/element.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,9 @@ async def set_value(
290290
FieldException: if the element does not have the specified field.
291291
"""
292292
try:
293-
await self._data_source_manager.set_value(field, value, units, data_source, throw)
293+
await self._data_source_manager.set_value(
294+
field, value, units, data_source, throw
295+
)
294296
except DataSourceException as e:
295297
raise DataSourceException(f"{self}: {e}")
296298
except FieldException as e:

src/pytac/lattice.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,9 @@ async def set_value(
240240
DataSourceException: if arguments are incorrect.
241241
FieldException: if the lattice does not have the specified field.
242242
"""
243-
await self._data_source_manager.set_value(field, value, units, data_source, throw)
243+
await self._data_source_manager.set_value(
244+
field, value, units, data_source, throw
245+
)
244246

245247
def get_length(self):
246248
"""Returns the length of the lattice, in meters.
@@ -643,7 +645,7 @@ async def get_element_values(
643645
family, field, values, pytac.ENG, pytac.PHYS
644646
)
645647
else:
646-
values = super(EpicsLattice, self).get_element_values(
648+
values = await super(EpicsLattice, self).get_element_values(
647649
family, field, handle, units, data_source, throw
648650
)
649651
if dtype is not None:
@@ -693,6 +695,6 @@ async def set_element_values(
693695
)
694696
await self._cs.set_multiple(pv_names, values, throw)
695697
else:
696-
super(EpicsLattice, self).set_element_values(
698+
await super(EpicsLattice, self).set_element_values(
697699
family, field, values, units, data_source, throw
698700
)

0 commit comments

Comments
 (0)