Skip to content

Commit

Permalink
flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
bimac committed Aug 23, 2023
1 parent c9f0d14 commit fb17fa0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/hardware_validation/verify_hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@

issues = 0


# function for querying a serial device
def query(s_obj, req, n=1, end: bool = False):
s_obj.write(req)
return s.read(n)


def log_fun(msg_type: str = 'info', msg: str = '', last: bool = False):
global issues
tree = '└' if last else '├'
Expand Down Expand Up @@ -210,7 +212,8 @@ def log_fun(msg_type: str = 'info', msg: str = '', last: bool = False):
elif len(module) > 1:
log_fun('fail', 'more than one Harp Sound Card connected to the Bpod', last=True)
else:
log_fun('pass', f'module "{module[0].name}" is connected to the Bpod\'s module port #{module[0].serial_port}',
log_fun('pass',
f'module "{module[0].name}" is connected to the Bpod\'s module port #{module[0].serial_port}',
last=True)
case _:
pass
Expand All @@ -225,7 +228,7 @@ def log_fun(msg_type: str = 'info', msg: str = '', last: bool = False):
(t, p, h) = unpack('3f', bytes(bpod.bpod_modules.module_read(module, 12)))
module.stop_module_relay()
log_fun('info', f'temperature: {t:.1f} °C')
log_fun('info', f'air pressure: {p/100:.1f} mbar')
log_fun('info', f'air pressure: {p / 100:.1f} mbar')
log_fun('info', f'rel. humidity: {h:.1f}%')
else:
log_fun('fail', 'Could not find Ambient Module', last=True)
Expand Down

0 comments on commit fb17fa0

Please sign in to comment.