Skip to content

Commit 0c2c868

Browse files
committed
removed isis specific lewis_version
1 parent 75be53c commit 0c2c868

File tree

152 files changed

+332
-1327
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+332
-1327
lines changed

lewis/devices/__init__.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ class StateMachineDevice(DeviceBase, CanProcessComposite):
9898
def __init__(
9999
self,
100100
override_states: dict[str, State] | None = None,
101-
override_transitions: dict[tuple[State, State], Callable[[], bool]]
102-
| None = None,
101+
override_transitions: dict[tuple[State, State], Callable[[], bool]] | None = None,
103102
override_initial_state: State | None = None,
104103
override_initial_data: dict[str, float] | None = None,
105104
) -> None:
@@ -115,17 +114,13 @@ def __init__(
115114
initial = override_initial_state or self._get_initial_state()
116115

117116
if initial not in state_handlers:
118-
raise RuntimeError(
119-
"Initial state '{}' is not a valid state.".format(initial)
120-
)
117+
raise RuntimeError("Initial state '{}' is not a valid state.".format(initial))
121118

122119
self._csm = StateMachine(
123120
{
124121
"initial": initial,
125122
"states": state_handlers,
126-
"transitions": self._get_final_transition_handlers(
127-
override_transitions
128-
),
123+
"transitions": self._get_final_transition_handlers(override_transitions),
129124
},
130125
context=self,
131126
)
@@ -151,9 +146,7 @@ def _get_initial_state(self) -> str:
151146
152147
:return: The initial state of the state machine.
153148
"""
154-
raise NotImplementedError(
155-
"_get_initial_state must be implemented in a StateMachineDevice."
156-
)
149+
raise NotImplementedError("_get_initial_state must be implemented in a StateMachineDevice.")
157150

158151
def _get_transition_handlers(self) -> dict[tuple[str, str], Callable[[], bool]]:
159152
"""
@@ -176,9 +169,7 @@ def _initialize_data(self) -> None:
176169
"""
177170
pass
178171

179-
def _get_final_state_handlers(
180-
self, overrides: dict[str, State] | None
181-
) -> dict[str, State]:
172+
def _get_final_state_handlers(self, overrides: dict[str, State] | None) -> dict[str, State]:
182173
states = self._get_state_handlers()
183174

184175
if overrides is not None:

lewis/devices/ag33220a/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from ..lewis_versions import LEWIS_LATEST
21
from .device import SimulatedAG33220A
32

4-
framework_version = LEWIS_LATEST
53
__all__ = ["SimulatedAG33220A"]

lewis/devices/ag33220a/device.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,7 @@ def set_new_voltage_high(self, new_voltage_high):
9494
9595
:param new_voltage_high: the value of voltage high to set to
9696
"""
97-
new_voltage_high = self.limit(
98-
new_voltage_high, self.VOLT_HIGH_MIN, self.VOLT_MAX
99-
)
97+
new_voltage_high = self.limit(new_voltage_high, self.VOLT_HIGH_MIN, self.VOLT_MAX)
10098
if new_voltage_high <= self.voltage_low:
10199
self.voltage_low = self.limit(
102100
new_voltage_high - self.VOLT_PRECISION, self.VOLT_MIN, new_voltage_high

lewis/devices/amint2l/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from ..lewis_versions import LEWIS_LATEST
21
from .device import SimulatedAmint2l
32

4-
framework_version = LEWIS_LATEST
53
__all__ = ["SimulatedAmint2l"]

lewis/devices/amint2l/interfaces/stream_interface.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ def handle_error(self, request, error):
3030
error: problem
3131
3232
"""
33-
self.log.error(
34-
"An error occurred at request " + repr(request) + ": " + repr(error)
35-
)
33+
self.log.error("An error occurred at request " + repr(request) + ": " + repr(error))
3634

3735
@if_connected
3836
def get_pressure(self, address):
@@ -50,11 +48,7 @@ def get_pressure(self, address):
5048
return None
5149
else:
5250
try:
53-
return "{stx}{pressure:+8.3f}".format(
54-
stx=chr(2), pressure=self._device.pressure
55-
)
51+
return "{stx}{pressure:+8.3f}".format(stx=chr(2), pressure=self._device.pressure)
5652
except ValueError:
5753
# pressure contains string probably OR (over range) or UR (under range)
58-
return "{stx}{pressure:8s}".format(
59-
stx=chr(2), pressure=self._device.pressure
60-
)
54+
return "{stx}{pressure:8s}".format(stx=chr(2), pressure=self._device.pressure)
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from ..lewis_versions import LEWIS_LATEST
21
from .device import SimulatedAttocubeANC350
32

4-
framework_version = LEWIS_LATEST
53
__all__ = ["SimulatedAttocubeANC350"]

lewis/devices/attocube_anc350/interfaces/stream_interface.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
BYTES_IN_INT = 4
88
HEADER_LENGTH = 4 * BYTES_IN_INT
99

10-
convert_to_response = partial(
11-
int_to_raw_bytes, length=BYTES_IN_INT, low_byte_first=True
12-
)
10+
convert_to_response = partial(int_to_raw_bytes, length=BYTES_IN_INT, low_byte_first=True)
1311

1412
# NB, all variables used from here onwards are named the same in the C driver
1513
# 'hump' in the controller refers to hardware limits
@@ -67,8 +65,7 @@ def convert_to_ints(command, start, end):
6765
Returns: A list of integers converted from the command.
6866
"""
6967
return [
70-
raw_bytes_to_int(command[x : x + BYTES_IN_INT])
71-
for x in range(start, end, BYTES_IN_INT)
68+
raw_bytes_to_int(command[x : x + BYTES_IN_INT]) for x in range(start, end, BYTES_IN_INT)
7269
]
7370

7471

@@ -112,9 +109,7 @@ class AttocubeANC350StreamInterface(StreamInterface):
112109
readtimeout = 10
113110

114111
def handle_error(self, request, error):
115-
self.log.error(
116-
"An error occurred at request " + repr(request) + ": " + repr(error)
117-
)
112+
self.log.error("An error occurred at request " + repr(request) + ": " + repr(error))
118113
return str(error)
119114

120115
def any_command(self, command):

lewis/devices/chopper/devices/states.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ def __init__(self, acceleration=5.0) -> None:
5353
self._acceleration = acceleration
5454

5555
def in_state(self, dt) -> None:
56-
self._context.speed = approaches.linear(
57-
self._context.speed, 0.0, self._acceleration, dt
58-
)
56+
self._context.speed = approaches.linear(self._context.speed, 0.0, self._acceleration, dt)
5957

6058
def on_entry(self, dt) -> None:
6159
self._context._stop_commanded = False

lewis/devices/chopper/interfaces/epics_interface.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,7 @@ class ChopperEpicsInterface(EpicsInterface):
7373
doc="Readback value of phase setpoint in degrees.",
7474
),
7575
"Phs": PV("target_phase", doc="Phase setpoint in degrees."),
76-
"ActPhs": PV(
77-
"phase", read_only=True, doc="Current phase of the chopper disc in degrees."
78-
),
76+
"ActPhs": PV("phase", read_only=True, doc="Current phase of the chopper disc in degrees."),
7977
"ParkAng-RB": PV(
8078
"target_parking_position",
8179
read_only=True,

lewis/devices/chtobisr/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from ..lewis_versions import LEWIS_LATEST
21
from .device import SimulatedChtobisr
32

4-
framework_version = LEWIS_LATEST
53
__all__ = ["SimulatedChtobisr"]

0 commit comments

Comments
 (0)