Skip to content

Commit deee463

Browse files
committed
ruff format and remove hamcrest use
1 parent 4d71d22 commit deee463

File tree

128 files changed

+339
-624
lines changed

Some content is hidden

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

128 files changed

+339
-624
lines changed

lewis/devices/Lksh218/device.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@
99

1010

1111
class SimulatedLakeshore218(StateMachineDevice):
12-
"""Simulated Lakeshore 218
13-
"""
12+
"""Simulated Lakeshore 218"""
1413

1514
def _initialize_data(self):
16-
"""Sets the initial state of the device.
17-
"""
15+
"""Sets the initial state of the device."""
1816
self._temps = [1.0] * NUMBER_OF_TEMP_CHANNELS
1917
self._sensors = [0.5] * NUMBER_OF_SENSOR_CHANNELS
2018
self.temp_all = ""
@@ -23,20 +21,17 @@ def _initialize_data(self):
2321

2422
@staticmethod
2523
def _get_state_handlers():
26-
"""Returns: States and their names.
27-
"""
24+
"""Returns: States and their names."""
2825
return {DefaultState.NAME: DefaultState()}
2926

3027
@staticmethod
3128
def _get_initial_state():
32-
"""Returns: The name of the initial state.
33-
"""
29+
"""Returns: The name of the initial state."""
3430
return DefaultState.NAME
3531

3632
@staticmethod
3733
def _get_transition_handlers():
38-
"""Returns: The state transitions.
39-
"""
34+
"""Returns: The state transitions."""
4035
return OrderedDict()
4136

4237
def get_temp(self, number):

lewis/devices/Lksh218/interfaces/stream_interface.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ def wrapper(*args):
2424

2525

2626
class Lakeshore218StreamInterface(StreamInterface):
27-
"""Stream interface for the serial port
28-
"""
27+
"""Stream interface for the serial port"""
2928

3029
in_terminator = "\r\n"
3130
out_terminator = "\r\n"

lewis/devices/Lksh218/states.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33

44
class DefaultState(State):
5-
"""Device is in default state.
6-
"""
5+
"""Device is in default state."""
76

87
NAME = "Default"

lewis/devices/ag33220a/device.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33

44
class SimulatedAG33220A(Device):
5-
"""Simulated AG33220A
6-
"""
5+
"""Simulated AG33220A"""
76

87
connected = True
98

lewis/devices/amint2l/device.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,22 @@
66

77

88
class SimulatedAmint2l(StateMachineDevice):
9-
"""Simulated AM Int2-L pressure transducer.
10-
"""
9+
"""Simulated AM Int2-L pressure transducer."""
1110

1211
def _initialize_data(self):
13-
"""Sets the initial state of the device.
14-
"""
12+
"""Sets the initial state of the device."""
1513
self.connected = True
1614
self.pressure = 2.0
1715
self.address = "AB"
1816

1917
def _get_state_handlers(self):
20-
"""Returns: states and their names
21-
"""
18+
"""Returns: states and their names"""
2219
return {DefaultState.NAME: DefaultState()}
2320

2421
def _get_initial_state(self):
25-
"""Returns: the name of the initial state
26-
"""
22+
"""Returns: the name of the initial state"""
2723
return DefaultState.NAME
2824

2925
def _get_transition_handlers(self):
30-
"""Returns: the state transitions
31-
"""
26+
"""Returns: the state transitions"""
3227
return OrderedDict()

lewis/devices/amint2l/interfaces/stream_interface.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Stream device for amint2l
2-
"""
1+
"""Stream device for amint2l"""
32

43
from lewis.adapters.stream import StreamInterface
54
from lewis.core.logging import has_log
@@ -11,8 +10,7 @@
1110

1211
@has_log
1312
class Amint2lStreamInterface(StreamInterface):
14-
"""Stream interface for the serial port
15-
"""
13+
"""Stream interface for the serial port"""
1614

1715
in_terminator = chr(3)
1816
out_terminator = chr(3)

lewis/devices/amint2l/states.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33

44
class DefaultState(State):
5-
"""Device is in default state.
6-
"""
5+
"""Device is in default state."""
76

87
NAME = "Default"

lewis/devices/attocube_anc350/device.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77

88
class SimulatedAttocubeANC350(StateMachineDevice):
99
def _initialize_data(self):
10-
"""Initialize all of the device's attributes.
11-
"""
10+
"""Initialize all of the device's attributes."""
1211
self.connected = True
1312
self.position = 0
1413
self.position_setpoint = 0

lewis/devices/attocube_anc350/states.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44

55
class MovingState(State):
6-
"""Device is in moving state.
7-
"""
6+
"""Device is in moving state."""
87

98
NAME = "Moving"
109

lewis/devices/chtobisr/device.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,10 @@ def build_code(codes_dict):
2121

2222

2323
class SimulatedChtobisr(StateMachineDevice):
24-
"""Class to simulate Coherent OBIS Laser Remote
25-
"""
24+
"""Class to simulate Coherent OBIS Laser Remote"""
2625

2726
def _initialize_data(self):
28-
"""Initialize all of the device's attributes.
29-
"""
27+
"""Initialize all of the device's attributes."""
3028
self.connected = True
3129
self.id = "Coherent OBIS Laser Remote - EMULATOR"
3230
self.interlock = "OFF" # "OFF" -> OPEN, "ON" -> CLOSED
@@ -99,8 +97,7 @@ def backdoor_set_interlock(self, value):
9997
self.interlock = value
10098

10199
def reset(self):
102-
"""Resets all parameters by calling initialize function
103-
"""
100+
"""Resets all parameters by calling initialize function"""
104101
self._initialize_data()
105102

106103
def build_status_code(self):

0 commit comments

Comments
 (0)