Skip to content

Commit b6a62e0

Browse files
Bump actions/setup-python from 4.4.0 to 4.6.0 (#52)
* Bump actions/setup-python from 4.4.0 to 4.6.0 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.4.0 to 4.6.0. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](actions/setup-python@v4.4.0...v4.6.0) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 49961d6 commit b6a62e0

File tree

4 files changed

+41
-21
lines changed

4 files changed

+41
-21
lines changed

.github/workflows/run-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838

3939
- name: Set up python
4040
id: setup-python
41-
uses: actions/setup-python@v4.4.0
41+
uses: actions/setup-python@v4.6.0
4242
with:
4343
python-version: ${{ matrix.python-version }}
4444
architecture: ${{ matrix.architecture }}

uoshardware/abstractions.py

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,10 @@ def execute_instruction(self, packet: NPCPacket) -> ComResult: # dead: disable
184184
185185
:param packet: A tuple containing the uint8 npc packet for the UOS instruction.
186186
:returns: ComResult object.
187-
:raises: UOSUnsupportedError if the interface hasn't been built correctly.
188-
:raises: UOSCommunicationError if there is a problem completing the action.
187+
:raises: UOSUnsupportedError if the interface hasn't been built
188+
correctly.
189+
:raises: UOSCommunicationError if there is a problem completing
190+
the action.
189191
"""
190192
raise UOSUnsupportedError(
191193
f"UOSInterfaces must over-ride {UOSInterface.execute_instruction.__name__} prototype."
@@ -200,8 +202,10 @@ def read_response(
200202
:param expect_packets: How many packets including ACK to expect
201203
:param timeout_s: The maximum time this function will wait for data.
202204
:return: COM Result object.
203-
:raises: UOSUnsupportedError if the interface hasn't been built correctly.
204-
:raises: UOSCommunicationError if there is a problem completing the action.
205+
:raises: UOSUnsupportedError if the interface hasn't been built
206+
correctly.
207+
:raises: UOSCommunicationError if there is a problem completing
208+
the action.
205209
"""
206210
raise UOSUnsupportedError(
207211
f"UOSInterfaces must over-ride {UOSInterface.read_response.__name__} prototype."
@@ -212,8 +216,10 @@ def hard_reset(self) -> ComResult:
212216
"""UOS loop reset functionality should be as hard a reset as possible.
213217
214218
:return: COM Result object.
215-
:raises: UOSUnsupportedError if the interface hasn't been built correctly.
216-
:raises: UOSCommunicationError if there is a problem completing the action.
219+
:raises: UOSUnsupportedError if the interface hasn't been built
220+
correctly.
221+
:raises: UOSCommunicationError if there is a problem completing
222+
the action.
217223
"""
218224
raise UOSUnsupportedError(
219225
f"UOSInterfaces must over-ride {UOSInterface.hard_reset.__name__} prototype"
@@ -223,8 +229,10 @@ def hard_reset(self) -> ComResult:
223229
def open(self):
224230
"""Abstract method for opening a connection to a UOSInterface.
225231
226-
:raises: UOSUnsupportedError if the interface hasn't been built correctly.
227-
:raises: UOSCommunicationError if there is a problem completing the action.
232+
:raises: UOSUnsupportedError if the interface hasn't been built
233+
correctly.
234+
:raises: UOSCommunicationError if there is a problem completing
235+
the action.
228236
"""
229237
raise UOSUnsupportedError(
230238
f"UOSInterfaces must over-ride {UOSInterface.open.__name__} prototype."
@@ -234,8 +242,10 @@ def open(self):
234242
def close(self):
235243
"""Abstract method for closing a connection to a UOSInterface.
236244
237-
:raises: UOSUnsupportedError if the interface hasn't been built correctly.
238-
:raises: UOSCommunicationError if there is a problem completing the action.
245+
:raises: UOSUnsupportedError if the interface hasn't been built
246+
correctly.
247+
:raises: UOSCommunicationError if there is a problem completing
248+
the action.
239249
"""
240250
raise UOSUnsupportedError(
241251
f"UOSInterfaces must over-ride {UOSInterface.close.__name__} prototype."
@@ -246,7 +256,8 @@ def is_active(self) -> bool:
246256
"""Abstract method for checking if a connection is being held active.
247257
248258
:return: Success boolean.
249-
:raises: UOSUnsupportedError if the interface hasn't been built correctly.
259+
:raises: UOSUnsupportedError if the interface hasn't been built
260+
correctly.
250261
"""
251262
raise UOSUnsupportedError(
252263
f"UOSInterfaces must over-ride {UOSInterface.close.__name__} prototype."
@@ -258,7 +269,8 @@ def enumerate_devices() -> list:
258269
"""Return a list of UOSDevices visible to the driver.
259270
260271
:return: A list of possible UOSInterfaces on the server.
261-
:raises: UOSUnsupportedError if the interface hasn't been built correctly.
272+
:raises: UOSUnsupportedError if the interface hasn't been built
273+
correctly.
262274
"""
263275
raise UOSUnsupportedError(
264276
f"UOSInterfaces must over-ride {UOSInterface.enumerate_devices.__name__} prototype."

uoshardware/api.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ class UOSDevice: # dead: disable
5858
"""Class for high level object-orientated control of UOS devices.
5959
6060
:ivar identity: The type of device, this is must have a valid device in the config.
61-
:ivar address: Compliant connection string for identifying the device and interface.
61+
:ivar address: Compliant connection string for identifying the
62+
device and interface.
6263
"""
6364

6465
__device: Device # Device definitions as parsed from a compatible ini.
@@ -158,9 +159,11 @@ def get_gpio_input(
158159
) -> ComResult:
159160
"""Read a GPIO pins level from device and returns the value.
160161
161-
:param pin: The numeric number of the pin as defined in the dictionary for that device.
162+
:param pin: The numeric number of the pin as defined in the
163+
dictionary for that device.
162164
:param pull_up: Enable the internal pull-up resistor. Default is false.
163-
:param volatility: How volatile should the command be, use constants from uoshardware.
165+
:param volatility: How volatile should the command be, use
166+
constants from uoshardware.
164167
:return: ComResult object.
165168
"""
166169
result = self.__execute_instruction(
@@ -210,7 +213,8 @@ def get_system_info(self) -> ComResult:
210213
def reset_all_io(self, volatility=Persistence.RAM) -> ComResult:
211214
"""Execute the reset IO at the defined volatility level.
212215
213-
:param volatility: Where should the pins reset from, use constants from uoshardware.
216+
:param volatility: Where should the pins reset from, use
217+
constants from uoshardware.
214218
:return: ComResult object containing the result of the reset operation..
215219
"""
216220
return self.__execute_instruction(
@@ -251,7 +255,8 @@ def __execute_instruction(
251255
:param instruction_data: device_functions from the LUT, payload ect.
252256
:param retry: Allows the instruction to retry execution when fails.
253257
:return: ComResult object
254-
:raises: UOSUnsupportedError if function is not possible on the loaded device.
258+
:raises: UOSUnsupportedError if function is not possible on the
259+
loaded device.
255260
"""
256261
if (
257262
function.name not in self.__device.functions_enabled

uoshardware/interface/serial.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ class Serial(UOSInterface):
1717
"""Pyserial class that handles reading / writing to ports.
1818
1919
:ivar _device: Holds the pyserial device once opened. None if not opened.
20-
:ivar _connection: Holds the standard connection string 'Interface'|'OS Connection String.
20+
:ivar _connection: Holds the standard connection string
21+
'Interface'|'OS Connection String.
2122
:ivar _port: Holds the port class, none type if device not instantiated.
2223
:ivar _kwargs: Additional keyword arguments as defined in the documentation.
2324
"""
@@ -100,7 +101,8 @@ def execute_instruction(self, packet: NPCPacket):
100101
"""Build and execute a new instruction packet.
101102
102103
:param packet: A tuple containing the uint8 npc packet for the UOS instruction.
103-
:return: Tuple containing a status boolean and index 0 and a result-set dict at index 1.
104+
:return: Tuple containing a status boolean and index 0 and a
105+
result-set dict at index 1.
104106
"""
105107
if self._device is None:
106108
raise UOSCommunicationError(
@@ -171,7 +173,8 @@ def read_response(self, expect_packets: int, timeout_s: float):
171173
def hard_reset(self):
172174
"""Manually drive the DTR line low to reset the device.
173175
174-
:return: Tuple containing a status boolean and index 0 and a result-set dict at index 1.
176+
:return: Tuple containing a status boolean and index 0 and a
177+
result-set dict at index 1.
175178
"""
176179
if self._device is None:
177180
raise UOSCommunicationError("Connection must be open to hard reset device.")

0 commit comments

Comments
 (0)